@Override protected FriendSubscribe doInBackground(Long... params) { id = params[0].intValue(); FriendSubscribe friendsQuery = new FriendSubscribe(appSettings, params[0]); friendsQuery.getResponse(WebQuery.GET); return friendsQuery; }
@Override protected void onPostExecute(FriendSubscribe query) { super.onPostExecute(query); final FriendFollowing.Friend f = (FriendFollowing.Friend) allFriends.find(id); FriendSubscribe.Data d = (FriendSubscribe.Data) query.getData(); if (d.getAllow()) { f.setWatched(1); adapter.notifyDataSetChanged(); } else { AlertDialog.Builder b = new AlertDialog.Builder(ac); b.setTitle(ac.getResources().getString(R.string.alert)) .setMessage(ac.getResources().getString(R.string.this_prifile)) .setNegativeButton( ac.getResources().getString(R.string.ok), new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dialog.cancel(); f.setWatched(2); adapter.notifyDataSetChanged(); } }); AlertDialog dialog = b.create(); dialog.show(); } adapter.notifyDataSetChanged(); }