Only use 3.X workarounds on 3.X
This commit is contained in:
		
							parent
							
								
									2f80d37c24
								
							
						
					
					
						commit
						c7b16c6713
					
				@ -18,6 +18,7 @@
 | 
			
		||||
 | 
			
		||||
package org.fdroid.fdroid;
 | 
			
		||||
 | 
			
		||||
import android.os.Build;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.support.v4.app.FragmentManager;
 | 
			
		||||
import android.support.v4.app.NavUtils;
 | 
			
		||||
@ -44,7 +45,9 @@ public class PreferencesActivity extends ActionBarActivity {
 | 
			
		||||
            // a (bug?) thing in 3.0, 3.1 which requires setContentView to be invoked before
 | 
			
		||||
            // the actionbar is played with:
 | 
			
		||||
            // http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html
 | 
			
		||||
            setContentView(new LinearLayout(this));
 | 
			
		||||
            if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) {
 | 
			
		||||
                setContentView(new LinearLayout(this));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            PreferencesFragment preferencesFragment = new PreferencesFragment();
 | 
			
		||||
            fm.beginTransaction()
 | 
			
		||||
 | 
			
		||||
@ -19,6 +19,7 @@
 | 
			
		||||
package org.fdroid.fdroid;
 | 
			
		||||
 | 
			
		||||
import android.content.Intent;
 | 
			
		||||
import android.os.Build;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.support.v4.app.FragmentManager;
 | 
			
		||||
import android.support.v4.app.NavUtils;
 | 
			
		||||
@ -50,7 +51,9 @@ public class SearchResults extends ActionBarActivity {
 | 
			
		||||
            // a (bug?) thing in 3.0, 3.1 which requires setContentView to be invoked before
 | 
			
		||||
            // the actionbar is played with:
 | 
			
		||||
            // http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html
 | 
			
		||||
            setContentView(new LinearLayout(this));
 | 
			
		||||
            if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) {
 | 
			
		||||
                setContentView(new LinearLayout(this));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            SearchResultsFragment fragment = new SearchResultsFragment();
 | 
			
		||||
            fm.beginTransaction().add(android.R.id.content, fragment).commit();
 | 
			
		||||
 | 
			
		||||
@ -31,6 +31,7 @@ import android.net.Uri;
 | 
			
		||||
import android.net.wifi.WifiInfo;
 | 
			
		||||
import android.net.wifi.WifiManager;
 | 
			
		||||
import android.os.AsyncTask;
 | 
			
		||||
import android.os.Build;
 | 
			
		||||
import android.os.Bundle;
 | 
			
		||||
import android.preference.PreferenceManager;
 | 
			
		||||
import android.support.v4.app.FragmentManager;
 | 
			
		||||
@ -125,7 +126,9 @@ public class ManageReposActivity extends ActionBarActivity {
 | 
			
		||||
             * http://blog.perpetumdesign.com/2011/08/strange-case-of
 | 
			
		||||
             * -dr-action-and-mr-bar.html
 | 
			
		||||
             */
 | 
			
		||||
            setContentView(new LinearLayout(this));
 | 
			
		||||
            if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) {
 | 
			
		||||
                setContentView(new LinearLayout(this));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            fm.beginTransaction()
 | 
			
		||||
                    .add(android.R.id.content, new RepoListFragment())
 | 
			
		||||
 | 
			
		||||
@ -43,7 +43,9 @@ public class RepoDetailsActivity extends ActionBarActivity {
 | 
			
		||||
            // a (bug?) thing in 3.0, 3.1 which requires setContentView to be invoked before
 | 
			
		||||
            // the actionbar is played with:
 | 
			
		||||
            // http://blog.perpetumdesign.com/2011/08/strange-case-of-dr-action-and-mr-bar.html
 | 
			
		||||
            setContentView(new LinearLayout(this));
 | 
			
		||||
            if (Build.VERSION.SDK_INT >= 11 && Build.VERSION.SDK_INT <= 13) {
 | 
			
		||||
                setContentView(new LinearLayout(this));
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            RepoDetailsFragment fragment = new RepoDetailsFragment();
 | 
			
		||||
            fragment.setArguments(getIntent().getExtras());
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user