Skip to content

Commit

Permalink
Handled No Internet condition
Browse files Browse the repository at this point in the history
  • Loading branch information
vivekrk committed Dec 26, 2011
1 parent 7af56e8 commit b46b9d7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/com/company/tweeter/TimelineActivity.java
Expand Up @@ -103,11 +103,19 @@ public void onCreate(Bundle savedInstanceState) {
initializeUI();

updateTimelineUI(TwitterAccount.TIMELINE);
// new GetStatuses().execute(newPages);
new PollForData().execute();
if (ImageDownloader.isNetworkConnected(getApplicationContext())) {
// new GetStatuses().execute(newPages);
new PollForData().execute();
} else {
Toast.makeText(getApplicationContext(), "No Internet Connection", Toast.LENGTH_SHORT).show();
}
} else {
try {
login();
if (ImageDownloader.isNetworkConnected(getApplicationContext())) {
login();
} else {
Toast.makeText(getApplicationContext(), "No Internet Connection", Toast.LENGTH_SHORT).show();
}
} catch (TwitterException e) {
Log.d(Constants.TAG, "Login failed");
}
Expand Down

0 comments on commit b46b9d7

Please sign in to comment.