Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6071287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:01:48+00:00 2026-05-23T10:01:48+00:00

I created a new Android application with a basic Toast message and options menu.

  • 0

I created a new Android application with a basic Toast message and options menu. For a while the app supported orientation changes without issue, but now it seems to no longer care about auto-rotating. Is there some magic setting that I wiped or set without knowing it? The literally has had no code changes since I first created it and it worked without issue.

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.somedomain.appname"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="4" />
    <application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
        <activity android:name=".StartActivity" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

StartActivity.java

package com.somedomain.appname;

import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

/** Main Activity **/
public class AppName extends Activity {

    /** Called when someone specifies to view the options menu **/
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {

        // Set
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.navigate, menu);

        // Return
        return true;
    }

    /* Handle options menu selections */
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {

        // Handle item selection
        switch (item.getItemId()) {

            case R.id.itemNewGame:
                // New Game
                return true;
            case R.id.itemSettings:
                // Settings
                return true;
            case R.id.itemAbout:
                // About
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }

    }

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {

        // Super
        super.onCreate(savedInstanceState);

        // Set
        setContentView(R.layout.main);      

        // First time?
        if ( savedInstanceState == null ) // null the first time
        {        
            // Splash
            LayoutInflater inflater = getLayoutInflater();
            View layout = inflater.inflate(R.layout.splash, (ViewGroup) findViewById(R.id.frameLayout1));
            Toast toast = new Toast(getApplicationContext());
            toast.setGravity(Gravity.CENTER_VERTICAL, 0, 0);
            toast.setDuration(Toast.LENGTH_LONG);
            toast.setView(layout);
            toast.show();
        }
    }

}

main.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
</LinearLayout>

splash.xml

<?xml version="1.0" encoding="utf-8"?>
    <FrameLayout android:id="@+id/frameLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">      
    <ImageView 
android:src="@drawable/logo" src="@drawable/logo" android:layout_height="fill_parent" android:layout_width="fill_parent" android:scaleType="centerInside" android:padding="30dip"/>
    </FrameLayout>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T10:01:48+00:00Added an answer on May 23, 2026 at 10:01 am

    Please check if you have rotation enable on phone, sometimes I forgot it too 😛

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to start android tablet application development. i have created a new avd
i am new to android application.I have created two sample applications as Oneproject,Twoproject.when i
I've created new db via phpMyAdmin and while editing db privilages clicked delete localhost
I created a new ASP.NET MVC application. The home page looks like this: I
I'm very new to Android. I'm thinking about creating an application that uses multiple
I am absolutely new to the Android platform and have been building an application
I'm creating a cool Home application in Android. As this is a Home app
In my small android application I created a Service to receive some string from
I need to work with REST api in android application which is created by
I'm quite new to android, but I have already created several apps and published,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.