Merge pull request #148 from misaochan/commons-application

Fix NullPointerException in CommonsApplication.java
This commit is contained in:
Nicolas Raoul 2016-07-01 14:44:51 +09:00 committed by GitHub
commit 845c0b1c11
2 changed files with 4 additions and 8 deletions

View file

@ -203,6 +203,9 @@ public class CommonsApplication extends Application {
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
return false; return false;
} catch (NullPointerException e) {
e.printStackTrace();
return false;
} }
} }

View file

@ -62,7 +62,6 @@ public class ContributionsActivity
super(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE); super(WikiAccountAuthenticator.COMMONS_ACCOUNT_TYPE);
} }
private ServiceConnection uploadServiceConnection = new ServiceConnection() { private ServiceConnection uploadServiceConnection = new ServiceConnection() {
public void onServiceConnected(ComponentName componentName, IBinder binder) { public void onServiceConnected(ComponentName componentName, IBinder binder) {
uploadService = (UploadService) ((HandlerService.HandlerServiceLocalBinder)binder).getService(); uploadService = (UploadService) ((HandlerService.HandlerServiceLocalBinder)binder).getService();
@ -75,8 +74,6 @@ public class ContributionsActivity
} }
}; };
@Override @Override
protected void onDestroy() { protected void onDestroy() {
super.onDestroy(); super.onDestroy();
@ -85,7 +82,6 @@ public class ContributionsActivity
} }
} }
@Override @Override
protected void onResume() { protected void onResume() {
super.onResume(); super.onResume();
@ -116,7 +112,6 @@ public class ContributionsActivity
setTitle(R.string.title_activity_contributions); setTitle(R.string.title_activity_contributions);
setContentView(R.layout.activity_contributions); setContentView(R.layout.activity_contributions);
contributionsList = (ContributionsListFragment)getSupportFragmentManager().findFragmentById(R.id.contributionsListFragment); contributionsList = (ContributionsListFragment)getSupportFragmentManager().findFragmentById(R.id.contributionsListFragment);
getSupportFragmentManager().addOnBackStackChangedListener(this); getSupportFragmentManager().addOnBackStackChangedListener(this);
@ -129,7 +124,6 @@ public class ContributionsActivity
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
} }
} }
requestAuthToken(); requestAuthToken();
} }
@ -290,8 +284,7 @@ public class ContributionsActivity
getSupportActionBar().setDisplayHomeAsUpEnabled(false); getSupportActionBar().setDisplayHomeAsUpEnabled(false);
} }
} }
public void refreshSource() { public void refreshSource() {
getSupportLoaderManager().restartLoader(0, null, this); getSupportLoaderManager().restartLoader(0, null, this);
} }