Android Emulator Always on Landscape - android

I would like to ask why is that my android emulator always displays on landscape even though I have a android:orientation="horizontal" on my code here is my screenshot
and when I change it to portrait mode using ctrl + f11 it is still on landscape mode.
Android Manifest
`
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Calculation"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.CALCULATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Instruction"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.INSTRUCTION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Tips"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.TIPS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".BillingCenter"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.BILLINGCENTER" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".AboutUs"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.project.billmoko.ABOUTUS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>`
XML File
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#drawable/background2"
android:screenOrientation="portrait" >

Please try replacing "horizontal" with "portrait". If that doesn't work please post your manifest, or at least the activity part of it. Note that this is an activity-specific attribute, not application. If you want all your activities to have one specific orientation you need to set this attribute in each one in the manifest.
Good luck!

Have you use the Google APIs with the Emulator, you can try to change the Google APIs to normal Android API. May the two answers help you

Related

How to make default android Launcher

I am trying to create a launcher application and I did it fine.
but there is a problem with my launcher:
When I choose it as default launcher for a device with pressing back button of device my launcher will disappear and last default launcher will appear!
this is my manifest:
<?xml version="1.0" encoding="utf-8"?>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AppsListActivity"/>
</application>
Thank you for your help.
<activity
android:name="ah.hathi.simplelauncher.HomeActivity"
android:label="Simple Launcher Home"
android:theme="#android:style/Theme.Wallpaper.NoTitleBar.Fullscreen"
android:launchMode="singleTask"
android:stateNotNeeded="true"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
do it like this hope this will work for you

Wrong Activity Launching On Start up Android

When i start my app it launches the wrong activity, i am new to coding so if you could keep the answer as simple as possible and tell me where i was going wrong it would be great, thanks in advance
This is my AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Dust2"
android:label="#string/title_activity_dust2" >
<intent-filter>
<action android:name="csgosmokes.csgo.dust2" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>
</application>
Remove
<intent-filter>
<action android:name="csgosmokes.csgo.dust2" />
<category android:name="android.intent.category.default" />
</intent-filter>
From
<activity
android:name=".Dust2"
android:label="#string/title_activity_dust2" >
<intent-filter>
<action android:name="csgosmokes.csgo.dust2" />
<category android:name="android.intent.category.default" />
</intent-filter>
</activity>

My app icon does not appear in the emulator home screen

I want specific ordered reasons why my app icon does not appear, I can run it on the emulator yet and I need to know what's wrong with my app? I'm a beginner my code is so simple, though I can't find why is this happening.
Here is my manifest:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.launcher" />
</intent-filter>
</activity>
<activity
android:name=".MyActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.example.hp.app2.MyActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Instead of
<category android:name="android.intent.category.launcher" />
it must be
<category android:name="android.intent.category.LAUNCHER" />

android Application installed but not showing on screen

My application is installed on real device as well on emulator but it does not display on my device screen as well on emulator screen. I mean to say here that whenever an app is run or installed on a device it opens up but here my app does not open it just installed and no error are shown or forced stop is not there. I even checked my download file where every app info is shown and it is present there. Can anyone help???? Thank you in advance.
This is my Manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.hide"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.hide.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.hide.Info"
android:label="#string/title_activity_info" >
<intent-filter>
<action android:name="com.example.hide.Info" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.hide.Help"
android:label="#string/title_activity_help" >
<intent-filter>
<action android:name="com.example.hide.Help" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.example.hide.Next"
android:label="#string/title_activity_next" >
<intent-filter>
<action android:name="com.example.hide.Next" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Make sure you specify the launcher activity for the app in your AndroidManifest.xml file:
<activity android:name=".YOURACTIVITY" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
More information here: http://developer.android.com/training/basics/activity-lifecycle/starting.html
If you have <data android:mimeType="image/*" /> in intent filter of your Launcher activity, then remove it.
just place following two lines < action and category) as:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
If you can see it in app list, but not shown on app screen, so I suppose you could be just missing 'android:icon="#drawable/your_app_icon"' setting in your manifest file.

No launcher in manifest?

I have 2 activity, I want to run one first. If I run this code, Console will write this: No Launcher activity found!, but i declared LAUNCHER in manifest?
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.manif"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.manif.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> //<--here is a problem, i think
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.manif.SECOND_CLASS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Change the action name to :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
try to replace this
<intent-filter>
<action android:name="com.example.manif.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
with this
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Don't use intent filter and other thing second time-
<activity
android:name=".MainActivity"
android:label="#string/app_name" />
This code is enough for second activity.
just remove tag:
<action android:name="com.example.manif.SECOND_CLASS" />

Categories

Resources