Back to project page jive-android-core-sdk-example.
The source code is released under:
Apache License
If you think the Android project jive-android-core-sdk-example listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jivesoftware.example.github.authentication; /* w w w .j a va 2 s . c o m*/ import android.app.Activity; import android.content.Context; import android.os.Bundle; import android.view.Menu; import com.jivesoftware.example.github.GitHubBasicAuthRequestInterceptor; import com.jivesoftware.example.github.GitHubServiceFactory; import com.jivesoftware.example.github.service.IGitHubAuthService; import com.jivesoftware.example.injection.BaseModule; import com.jivesoftware.example.utils.ActivityLauncher; import dagger.Module; import dagger.ObjectGraph; import dagger.Provides; import javax.inject.Inject; public class GitHubAuthenticationActivity extends Activity{ @Inject GitHubAuthenticationModel model; @Inject GitHubAuthenticationView view; @Inject ActivityLauncher launcher; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ObjectGraph.create(new GitHubAuthenticationModule()).inject(this); GitHubAuthenticationPresenter.create(this, model, view, launcher); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(com.jivesoftware.example.R.menu.main, menu); return true; } @Module( injects = GitHubAuthenticationActivity.class, includes = BaseModule.class ) public class GitHubAuthenticationModule { @Provides public Context provideActivityContext() { return GitHubAuthenticationActivity.this; } @Provides public IGitHubAuthService provideGitHubAuthService(GitHubBasicAuthRequestInterceptor interceptor) { return GitHubServiceFactory.createAuthService(interceptor, new GitHubAuthenticationErrorHandler()); } } }