tweet adapter bug fix
This commit is contained in:
parent
578b9c471a
commit
13bd2f8c0d
@ -78,6 +78,12 @@ public class TweetAdapter extends Adapter<TweetAdapter.ItemHolder> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
tweets = new Tweet[0];
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public boolean isEmpty() {
|
public boolean isEmpty() {
|
||||||
return tweets.length == 0;
|
return tweets.length == 0;
|
||||||
}
|
}
|
||||||
|
@ -118,8 +118,10 @@ public class TweetListFragment extends Fragment implements OnRefreshListener, On
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int reqCode, int returnCode, Intent i) {
|
public void onActivityResult(int reqCode, int returnCode, Intent i) {
|
||||||
if (reqCode == REQUEST_TWEET_CHANGED && returnCode == RETURN_TWEET_CHANGED)
|
if (reqCode == REQUEST_TWEET_CHANGED && returnCode == RETURN_TWEET_CHANGED) {
|
||||||
|
adapter.clear();
|
||||||
tweetTask = null;
|
tweetTask = null;
|
||||||
|
}
|
||||||
super.onActivityResult(reqCode, returnCode, i);
|
super.onActivityResult(reqCode, returnCode, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user