mirror of
				https://github.com/commons-app/apps-android-commons.git
				synced 2025-10-30 22:34:02 +01:00 
			
		
		
		
	Override auth cookie required
This commit is contained in:
		
							parent
							
								
									14ce5da674
								
							
						
					
					
						commit
						df1d5527e6
					
				
					 1 changed files with 19 additions and 1 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| package fr.free.nrw.commons.contributions; | ||||
| 
 | ||||
| import android.content.Intent; | ||||
| import android.os.Bundle; | ||||
| import android.support.design.widget.TabLayout; | ||||
| import android.support.v4.view.ViewPager; | ||||
|  | @ -8,21 +9,28 @@ import javax.inject.Inject; | |||
| 
 | ||||
| import butterknife.BindView; | ||||
| import butterknife.ButterKnife; | ||||
| import fr.free.nrw.commons.BuildConfig; | ||||
| import fr.free.nrw.commons.R; | ||||
| import fr.free.nrw.commons.auth.AuthenticatedActivity; | ||||
| import fr.free.nrw.commons.auth.SessionManager; | ||||
| import fr.free.nrw.commons.upload.UploadService; | ||||
| 
 | ||||
| import static android.content.ContentResolver.requestSync; | ||||
| 
 | ||||
| public  class       ContributionsActivity | ||||
|         extends     AuthenticatedActivity { | ||||
| 
 | ||||
|     @Inject | ||||
|     SessionManager sessionManager; | ||||
| 
 | ||||
|     @BindView(R.id.tab_layout) | ||||
|     TabLayout tabLayout; | ||||
|     @BindView(R.id.pager) | ||||
|     ViewPager viewPager; | ||||
| 
 | ||||
| 
 | ||||
|     public Intent uploadServiceIntent; | ||||
|     public boolean isAuthCookieAcquired = false; | ||||
| 
 | ||||
|     public void onCreate(Bundle savedInstanceState) { | ||||
|         super.onCreate(savedInstanceState); | ||||
|         setContentView(R.layout.activity_contributions); | ||||
|  | @ -39,7 +47,17 @@ public  class       ContributionsActivity | |||
| 
 | ||||
|     @Override | ||||
|     protected void onAuthCookieAcquired(String authCookie) { | ||||
|         // Do a sync everytime we get here! | ||||
|         requestSync(sessionManager.getCurrentAccount(), BuildConfig.CONTRIBUTION_AUTHORITY, new Bundle()); | ||||
|         uploadServiceIntent = new Intent(this, UploadService.class); | ||||
|         uploadServiceIntent.setAction(UploadService.ACTION_START_SERVICE); | ||||
|         startService(uploadServiceIntent); | ||||
| 
 | ||||
|         //addTabsAndFragments(); | ||||
|         isAuthCookieAcquired = true; | ||||
|         /*if (contributionsFragment != null) { | ||||
|             contributionsFragment.onAuthCookieAcquired(uploadServiceIntent); | ||||
|         }*/ | ||||
|     } | ||||
| 
 | ||||
|     @Override | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 neslihanturan
						neslihanturan