Collections.sort(allLawyersList, new Comparator<OneLawyerClass>() {
@Override
public int compare(OneLawyerClass o1, OneLawyerClass o2) {
return Integer.parseInt(o1.getLawyerID()) < Integer.parseInt(o2.getLawyerID()) ? 1
: (Integer.parseInt(o1.getLawyerID()) > Integer.parseInt(o2.getLawyerID()) ? -1 : 0);
}
});
connection.setRequestProperty("id_app", id_app);
DataOutputStream outputStream = new DataOutputStream(connection.getOutputStream());
outputStream.writeBytes(twoHyphens + boundary + lineEnd);
outputStream.writeBytes("Content-Disposition: form-data; name=\"id_app\"" + lineEnd + lineEnd + id_app + lineEnd);
private Callbacks callbacks;
public interface Callbacks {
void onAppAccept(int position);
void onAppEdit(int position);
void onAppDelete(int position);
}
public void setCallbacks(Callbacks callbacks) {
this.callbacks = callbacks;
}
holder.appEdit = (Button) convertView.findViewById(R.id.appEdit);
holder.appEdit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
callbacks.onAppEdit(position);
}
});
oneAppAdminAdapter = new OneAppAdminAdapter(AllAppsAdminFragment.this, allAppsList);
oneAppAdminAdapter.setCallbacks(new OneAppAdminAdapter.Callbacks() {
@Override
public void onAppAccept(int position) {
//вызов асинтаска принятия
}
@Override
public void onAppEdit(int position) {
//вызов фрагмента редактирования
}
@Override
public void onAppDelete(int position) {
//вызов асинтаска удаления
}
});
setListAdapter(oneAppAdminAdapter);
Bundle bundle = new Bundle();
bundle.putString("headers", Headers);
Intent intent = new Intent(LoginActivity.this, MyPageActivity.class);
intent.putExtras(bundle);
startActivity(intent);
Bundle bundle=getIntent().getExtras();
String headers2 = bundle.getString("headers");
TextView outputView = (TextView) findViewById(R.id.responseView);
outputView.setText(headers2);