Android Application is not showing up in the App Drawer - android

Hey I have a bit of a problem trying to locate my application in the App Drawer, it shows up everywhere else - Recent Applications (by holding down home) and it is also in the settings under Applications.
The only place it isn't is in the app drawer, my first guess is the Manifest?
The application runs perfectly fine.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zaknorris.brainhacker.v1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="Brain Hacker Pro"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="Brain Hacker Pro" >
<intent-filter>
<action android:name="com.zaknorris.brainhacker.v1.Menu" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".attentionbuilder"
android:label="Attention Builder" >
<intent-filter>
<action android:name="com.zaknorris.brainhacker.v1.attentionbuilder" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
The icon is in the drawable is there and everything.
Not sure what's going on :\
New in Java

you need to have this:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
inside of one of your activity elements

Change your AndroidManifest to this one:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.zaknorris.brainhacker.v1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<application
android:icon="#drawable/ic_launcher"
android:label="Brain Hacker Pro"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="Brain Hacker Pro" >
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".attentionbuilder"
android:label="Attention Builder" >
<intent-filter>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>

Set MainLauncher=true in IntentFilter for the activity which you would want to open first. This answer is with respect to Xmarin.android.
For android Java:
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>

Related

Unable to open the app when disable the Open button after APK installation

I am disabling 'Open' button which comes up after APK installation. But my app does not open after it. It gives me error 'Sorry not able to open the application' after I try to open it. I tried all the possible solution but nothing works.
Thanks in advance.
Manifest as follows :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.activity"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="21" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.GET_TASKS"/>
<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>
<action android:name="android.intent.action.VIEW">
<category android:name="android.intent.category.DEFAULT">
<category android:name="android.intent.category.BROWSABLE">
<data android:scheme="callback" android:host="com.example.activity"/>
</category>
</category>
</action>
</intent-filter>
</action>
</intent-filter>
</activity>
</application>
</manifest>
You must have made a mistake in your intent-filters. Try to replace your <activity> element with this one:
<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>
<intent-filter>
<action android:name="android.intent.action.VIEW">
<category android:name="android.intent.category.DEFAULT">
<category android:name="android.intent.category.BROWSABLE">
<data android:scheme="callback" android:host="com.example.activityname"/>
</intent-filter>
</activity>

Widget with separate settings activity

I've been following THIS tutorial to create a Widget with configuration activity. When you add the widget to the homescreen it shows the settings activity and changes the widget look accordingly. But after that you can't change the look.
However I would like for the settings activity to be separate, meaning that there is an icon in the apps menu and when you press it, settings show up and you can change the widget look.
I've tried changing the Main launcher in Android Manifest to the Settings activity, but it doesn't work. How can this be created?
AndroidManifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.wptrafficanalyzer.appwidgetclockconfiguration"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
</intent-filter>
</activity>
<activity android:name=".WidgetConfigurationActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
</activity>
<receiver android:name="AnalogClockWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/widget_info" />
</receiver>
</application>
Try this, it works for me:
<activity
android:name=".WidgetConfigurationActivity"
android:launchMode="singleTop"
android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>

Android if my launcher has not started and pressing home button

I've developed a launcher. In my device, there are 3 launcher with my application and the default launcher of Android. If I have not launched my application before, when I press home, my application appears on the launcher list. So, when I touch my launcher, it occurs error because of I didn't start it before. What can I do to solve this problem?
My manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.comeks.deneme"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.comeks.deneme.Main"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:excludeFromRecents="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:label="#string/app_name"
android:name=".main.java"
android:excludeFromRecents="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>
</activity>
</application>
</manifest>
What is the name of the file of your second activity?
main.java.java?
Do you even have two different activities?

Following android tab tutorial, can't find or launch installed app on device or emulator

Attempting to follow this project
http://thepseudocoder.wordpress.com/2011/10/04/android-tabs-the-fragment-way/
When I run it, it says everything installs alright but nothing comes up and it's not listed under apps. I find it under application manager.. What can cause an app to install and not launch?
edit:
Here's my manifest.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.tabs"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="10"
android:targetSdkVersion="17" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<activity android:name="TabsFragmentActivity" >
</activity>
</application>
</manifest>
Have you got a launcher Activity?
<activity
android:name=".MainActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> // this
</intent-filter>
</activity>
Edit:
You did not surround it with an Activity tag, so basically you don't have a launcher Activity, fix it like this:
[...]
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<activity android:name="TabsFragmentActivity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
[...]

exported apk showing activities when installed

I have exported an app with 3 activities (main, splash and another activity called "about") to an apk file. It works fine when tested on the emulator. After uploading to the Play Store and then downloading to my own phone, it installs fine on my phone. Good so far. However, the apk doesn't appear packaged - it's showing the separate activities and not starting with the splash screen as it did in the emulator. What could be the problem? It exported with no errors. When I was exporting, I gave the apk a name that was different than the package name in the manifest. Would this cause the problem? Here is the manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spinner"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AboutActivity"
android:label="#string/title_activity_about" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Thank you for looking.
This intent-filter
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
tells Android launcher app to show icon associated with Activity this filter is attached to on its Launcher screen. When corresponding icon is tapped by user, launcher app starts that activity and your code is executed. You usually want one entry point in your application so edit your Manifest file and ensure only one Activity element uses it. In your case, I guess leave it for SplashActivity and remove from others. It should look like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.spinner"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar" >
<activity
android:name=".SplashActivity"
android:label="#string/title_activity_splash" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainActivity"
android:label="#string/title_activity_main" >
</activity>
<activity
android:name=".AboutActivity"
android:label="#string/title_activity_about" >
</activity>
</application>
</manifest>
I'd also get rid of android:label from <activity> elements (just leave for <application>)

Categories

Resources