List of usage examples for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT
int SCREEN_ORIENTATION_PORTRAIT
To view the source code for android.content.pm ActivityInfo SCREEN_ORIENTATION_PORTRAIT.
Click Source Link
portrait
in the android.R.attr#screenOrientation attribute. From source file:de.gruenewald.udacity.spotifystreamer.MainActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //constrain orientation to portrait on smartphones if (getResources().getBoolean(R.bool.portrait_only)) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }//from www . j av a2 s . c om setContentView(R.layout.activity_main); mArtistFragment = (ArtistFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_artist); if (findViewById(R.id.fragment_track_container) instanceof FrameLayout) { mTrackContainer = (FrameLayout) findViewById(R.id.fragment_track_container); } mTrackFragment = null; //if savedInstanceState != null we are re-creating a previously existing MainActivity; thus //there should be a TrackFragment already. if (savedInstanceState != null && mTrackContainer != null) { mTrackFragment = (TrackFragment) getSupportFragmentManager() .findFragmentByTag(TrackActivity.TRACK_FRAGMENT_TAG); } else if (mTrackContainer != null) { mTrackFragment = new TrackFragment(); getSupportFragmentManager().beginTransaction() .replace(mTrackContainer.getId(), mTrackFragment, TrackActivity.TRACK_FRAGMENT_TAG).commit(); } AppController.getInstance().registerMainActivity(this); AppController.getInstance().registerArtistFragment(mArtistFragment); AppController.getInstance().registerTrackFragment(mTrackFragment); }
From source file:com.starclub.enrique.BuyActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_buy); mContext = this; UserDefault.init(this); StarTracker.StarSendView(this, "StarCredits"); /* /* w w w . j a v a2 s .com*/ // credit Intent intent = new Intent(this, PayPalService.class); intent.putExtra(PaymentActivity.EXTRA_PAYPAL_ENVIRONMENT, CONFIG_ENVIRONMENT); intent.putExtra(PaymentActivity.EXTRA_CLIENT_ID, CONFIG_CLIENT_ID); intent.putExtra(PaymentActivity.EXTRA_RECEIVER_EMAIL, CONFIG_RECEIVER_EMAIL); startService(intent); */ /* // in app billing v2 Log.i("BillingService", "Starting"); mContext = this; startService(new Intent(mContext, BillingService.class)); BillingHelper.setCompletedHandler(mTransactionHandler); */ // in app billing v3 // bp = new BillingProcessor(this, LICENSE_KEY, new BillingProcessor.IBillingHandler() { // @Override // public void onProductPurchased(String productId) { // showToast("onProductPurchased: " + productId); // updateTextViews(); // } // @Override // public void onBillingError(int errorCode, Throwable error) { // showToast("onBillingError: " + Integer.toString(errorCode)); // } // @Override // public void onBillingInitialized() { // readyToPurchase = true; //// updateTextViews(); // } // @Override // public void onPurchaseHistoryRestored() { // showToast("onPurchaseHistoryRestored"); // for(String sku : bp.listOwnedProducts()) // Log.d(TAG, "Owned Managed Product: " + sku); // for(String sku : bp.listOwnedSubscriptions()) // Log.d(TAG, "Owned Subscription: " + sku); //// updateTextViews(); // } // }); String base64EncodedPublicKey = LICENSE_KEY; // Create the helper, passing it our context and the public key to verify signatures with Log.d(TAG, "Creating IAB helper."); mHelper = new IabHelper(this, base64EncodedPublicKey); // enable debug logging (for a production application, you should set this to false). mHelper.enableDebugLogging(true); // Start setup. This is asynchronous and the specified listener // will be called once setup completes. Log.d(TAG, "Starting setup."); mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() { public void onIabSetupFinished(IabResult result) { Log.d(TAG, "Setup finished."); if (!result.isSuccess()) { // Oh noes, there was a problem. Log.d(TAG, "Problem setting up in-app billing: " + result); return; } // Have we been disposed of in the meantime? If so, quit. if (mHelper == null) return; // IAB is fully set up. Now, let's get an inventory of stuff we own. Log.d(TAG, "Setup successful. Querying inventory."); mHelper.queryInventoryAsync(mGotInventoryListener); } }); setInterface(); }
From source file:fr.eoit.activity.ParameterActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.parameters); setProgressBarIndeterminate(true);/*from ww w . j a va 2 s . c om*/ setProgressBarIndeterminateVisibility(true); if (Parameters.keyId <= 0) { Toast.makeText(this, R.string.parameters_not_set, Toast.LENGTH_LONG).show(); } skillLoadingProgress = (ProgressBar) findViewById(R.id.SKILL_LIST_LOADING); receiver = new SkillUpdaterBroadcastReceiver(skillLoadingProgress); refreshCharacterSpinner(); // The names of the cursor columns to display in the view, initialized to the title column String[] dataColumns = { Item.COLUMN_NAME_NAME, Parameter.COLUMN_NAME_PARAM_VALUE }; // The view IDs that will display the cursor columns, initialized to the TextView in // noteslist_item.xml int[] viewIDs = { R.id.ITEM_NAME, R.id.SKILL_LEVEL_ICON }; // Creates the backing adapter for the ListView. adapter = new SimpleCursorAdapter(this, R.layout.skillrow, null, dataColumns, viewIDs, SimpleCursorAdapter.FLAG_REGISTER_CONTENT_OBSERVER); adapter.setViewBinder(new SkillListViewBinder()); skillListView = (ListView) findViewById(R.id.SKILLS_LIST); skillListView.setVisibility(View.GONE); // Sets the ListView's adapter to be the cursor adapter that was just created. skillListView.setAdapter(adapter); findViewById(R.id.location_management_layout).setOnClickListener(new GenericIntentLauncherOnClickListener( fr.eoit.db.bean.Station.CONTENT_URI, LocationManagementActivity.class, getApplicationContext())); findViewById(R.id.MINING_REGION_LAYOUT).setOnClickListener(new ParametersMiningSpaceOnClickListener(this)); findViewById(R.id.MINING_REGION_SEC_LAYOUT) .setOnClickListener(new ParametersMiningSecOnClickListener(this)); ((CheckBox) findViewById(R.id.MINING_SWITCH)).setChecked(Parameters.isMiningActive); ((CheckBox) findViewById(R.id.MINING_SWITCH)).setOnCheckedChangeListener(new OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { Parameters.isMiningActive = isChecked; } }); initOrRestart(); }
From source file:com.jacr.instagramtrendreader.Main.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_main); /* Customizing ActionBar */ Resources r = getResources(); ActionBar ab = super.getActionBar(false); ab.setIcon(r.getDrawable(R.drawable.ic_menu_home)); ab.setTitle(Util.getTitleActivity(getString(R.string.title_my_gallery_app))); /* Views *///from w w w.ja v a2 s .com layoutThumbnail = (TableLayout) findViewById(R.id.layoutThumbnail); layoutThumbnail.setPadding(1, 1, 1, 1); /* Setting Viewpager and Indicator */ mPager = (ViewPager) findViewById(R.id.pagerMain); mAdapter = new ViewPagerAdapter<MainFragment>(getSupportFragmentManager()); mPager.setOnPageChangeListener(new OnPageChangeListener() { @Override public void onPageScrollStateChanged(int arg0) { } @Override public void onPageScrolled(int arg0, float arg1, int arg2) { } @Override public void onPageSelected(int arg0) { int key = feedReader.getListThumbnailKeys().get(arg0); feedReader.highlightThumbnail(key); } }); /* Receiver */ mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); Bundle extras = intent.getExtras(); if (action.contentEquals(ACTION_IMAGE_CLICK)) { int key = extras.getInt(ACTION_IMAGE_CLICK); if (key != -1) { Intent in = new Intent(Main.this, ImageDetails.class); Bundle b = new Bundle(); /* * Warning with Error FAILED BINDED TRANSACTION: it * happens When the transfer of "extras" out of memory. * in This case, when images are sent in intent. */ b.putSerializable(ImageDetails.KEY_THUMBNAIL_DATA, feedReader.getListThumbnailData()); b.putSerializable(ImageDetails.KEY_THUMBNAIL_KEYS, feedReader.getListThumbnailKeys()); b.putInt(ImageDetails.KEY_THUMBNAIL_ACTUAL_KEY, key); in.putExtras(b); startActivity(in); } } } }; IntentFilter filter = new IntentFilter(); filter.addAction(ACTION_IMAGE_CLICK); registerReceiver(mReceiver, filter); /* Load data from Instagram */ cargarFeedReader(); }
From source file:de.uulm.graphicalpasswords.openmiba.MIBALoginActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); // requestWindowFeature(Window.FEATURE_NO_TITLE); // getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, // WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_miba_login); // Show the Up button in the action bar. setupActionBar();/*from w ww. j a v a 2 s.c o m*/ SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this); rounds_to_do = Integer.parseInt(sharedPref.getString("miba_length", "1")); min_rounds = rounds_to_do; password = sharedPref.getString("miba_pw", ""); setViews(); }
From source file:eu.geopaparazzi.library.forms.FormActivity.java
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // make sure the orientation can't be changed once this activity started int currentOrientation = getResources().getConfiguration().orientation; if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else {// w w w . j a va 2 s . c om setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } Bundle extras = getIntent().getExtras(); if (extras != null) { sectionName = extras.getString(LibraryConstants.PREFS_KEY_FORM_NAME); sectionObjectString = extras.getString(LibraryConstants.PREFS_KEY_FORM_JSON); latitude = extras.getDouble(LibraryConstants.LATITUDE); longitude = extras.getDouble(LibraryConstants.LONGITUDE); elevation = extras.getDouble(LibraryConstants.ELEVATION); noteId = extras.getLong(LibraryConstants.DATABASE_ID); } try { if (sectionObjectString == null) { sectionObject = TagsManager.getInstance(this).getSectionByName(sectionName); // copy the section object, which will be kept around along the activity sectionObjectString = sectionObject.toString(); } sectionObject = new JSONObject(sectionObjectString); formNames4Section = TagsManager.getFormNames4Section(sectionObject); } catch (Exception e) { e.printStackTrace(); } setContentView(R.layout.form); }
From source file:org.jorge.lolin1.ui.activities.ChampionDetailFragmentActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); if (!preferences.getBoolean("showcase_champion_detail_done", Boolean.FALSE)) setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); selectedChampion = getIntent().getParcelableExtra(SELECTED_CHAMPION); super.onCreate(savedInstanceState); setContentView(R.layout.activity_champion_detail); ActionBar actionBar;/* w w w. j av a 2 s.c o m*/ assert getActionBar() != null; if (findViewById(R.id.champion_title) != null) { //Portrait layout if (!(actionBar = getActionBar()).isShowing()) { actionBar.show(); } actionBar.setDisplayHomeAsUpEnabled(Boolean.TRUE); ((TextView) findViewById(R.id.champion_name)).setText(selectedChampion.getName()); ((TextView) findViewById(R.id.champion_title)).setText(selectedChampion.getTitle()); initChampionInfoPager(); if (!preferences.getBoolean("showcase_champion_detail_done", Boolean.FALSE)) detailShowcase = new ShowcaseView.Builder(this).setContentText(R.string.tutorial_detail_contents) .setContentTitle(R.string.tutorial_detail_title) .setStyle(R.style.CustomShowcaseThemePlusNoButton) .setTarget(new ViewTarget(R.id.champion_detail_pager, this)).build(); ChampionDetailFragmentActivity.this.runOnUiThread(new Runnable() { @Override public void run() { ((ImageView) findViewById(R.id.champion_bust)) .setImageDrawable(new BitmapDrawable(getResources(), ChampionManager.getInstance() .getBustImageByChampion(200, 200, selectedChampion, getApplicationContext()))); } }); } else { //Landscape layout if ((actionBar = getActionBar()).isShowing()) { actionBar.hide(); } skinsViewPager = ((ViewPager) findViewById(R.id.skins_view_pager)); initChampionSkinsPager(); } }
From source file:passenger.view.activity.LoginActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.activity_login); mLoginState = LoginState.getInstance(LoginActivity.this); getAcache();//from ww w. j a va2 s . c o m isConnection = getResources().getString(R.string.no_connection); mConfirm = getResources().getString(R.string.confirm); checkVersionAndServerIsCanUse(); initLogin(); findID(); initUI(); }
From source file:br.org.funcate.dynamicforms.FragmentDetailActivity.java
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // don't permit rotation int currentOrientation = getResources().getConfiguration().orientation; if (currentOrientation == Configuration.ORIENTATION_LANDSCAPE) { setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); } else {/*from ww w .j a va 2 s . co m*/ setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); } String tags = ""; String defaultSectionName = FormUtilities.DEFAULT_SESSION_NAME; Intent intent = getIntent(); Bundle extras = intent.getExtras(); String geojsonTags = ""; if (extras != null) { pointId = extras.getLong(LibraryConstants.SELECTED_POINT_ID); formName = extras.getString(FormUtilities.ATTR_FORMNAME); tags = extras.getString(FormUtilities.ATTR_JSON_TAGS); if (extras.containsKey(FormUtilities.ATTR_GEOJSON_TAGS)) { geojsonTags = extras.getString(FormUtilities.ATTR_GEOJSON_TAGS); } // here are the attribute values from feature to populate form in edit operation if (extras.containsKey(FormUtilities.ATTR_DATA_VALUES)) { existingFeatureData = extras.getBundle(FormUtilities.ATTR_DATA_VALUES); } workingDirectory = extras.getString(FormUtilities.MAIN_APP_WORKING_DIRECTORY); } try { sectionObject = TagsManager.getInstance(tags).getSectionByName(defaultSectionName); if (sectionObject == null) { Toast.makeText(getApplicationContext(), "Failure on get form session.", Toast.LENGTH_LONG).show(); System.out.println("Failure on load JSON form from database."); this.finish(); } JSONObject geojson = new JSONObject(geojsonTags); sectionObject.put(FormUtilities.ATTR_GEOJSON_TAGS, geojson); } catch (JSONException e) { Toast.makeText(getApplicationContext(), "Incorrect form configuration.", Toast.LENGTH_LONG).show(); System.out.println("Failure on load JSON form from database."); e.printStackTrace(); this.finish(); } setContentView(R.layout.details_activity_layout); }
From source file:com.gsma.rcs.ri.sharing.geoloc.InitiateGeolocSharing.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); setContentView(R.layout.geoloc_sharing_initiate); initialize();/*from w ww. java2 s.c o m*/ if (!isServiceConnected(RcsServiceName.GEOLOC_SHARING)) { showMessageThenExit(R.string.label_service_not_available); return; } startMonitorServices(RcsServiceName.GEOLOC_SHARING); try { mGeolocSharingService.addEventListener(mListener); } catch (RcsServiceException e) { showExceptionThenExit(e); } }