I have a problem in AVD and eclipse.
I make new android app and when I try to run it on AVD or my android device but I get force close .
Manifest file :
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.azkar"
android:versionCode="1"
android:versionName="1.0" >
<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="com.your.package.YourLauncherActivity"
android:name=".main"
android:lable="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
If you are using this manifest file without any change then you need to change here from
<activity android:name="com.your.package.YourLauncherActivity"
android:name=".main"
android:lable="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
to
<activity android:name="com.example.azkar.YourLauncherActivity"
android:name=".main"
android:lable="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Replace this
<activity android:name="com.your.package.YourLauncherActivity"
with this:
<activity android:name="com.example.azkar.YourLauncherActivity"
below line makes problem to you"
<activity android:name="com.your.package.YourLauncherActivity"
make sure with your package and activity name:
<activity android:name="com.example.azkar.YourLauncherActivity"
Change
<activity android:name="com.your.package.YourLauncherActivity"
To
<activity android:name="com.example.azkar.YourLauncherActivity"
Related
I've made an application in eclipse using android project. Now I installed that APK-file on my smartphone.
When I hit install, it just installs, it's fine. But then I get the option "Cancel", or "open". But I can't click on "Open".
Just nothing happens every time I try to open it. It's not with my other apps.
I can find it at "downloads", but I just can't open it. I can update and install it again countless times. Unknown sources in my settings is on.
Does anyone know this issue, and/or how to fix it?
Help would be appreciated.
Manifest code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rodekruis"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="21" />
<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=".BezoekActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.example.rodekruis.BezoekActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".AfspraakActivity"
android:label="#string/title_activity_afspraak" >
</activity>
<activity
android:name=".ContactActivity"
android:label="#string/title_activity_contact" >
</activity>
<activity
android:name=".MeningActivity"
android:label="#string/title_activity_mening" >
</activity>
<activity
android:name=".RouteActivity"
android:label="#string/title_activity_route" >
</activity>
<activity
android:name=".SpecialistenActivity"
android:label="#string/title_activity_specialisten" >
</activity>
<activity
android:name=".BWCActivity"
android:label="#string/title_activity_bwc" >
</activity>
<activity
android:name=".AgendaActivity"
android:label="#string/title_activity_agenda" >
</activity>
<activity
android:name=".InfoActivity"
android:label="#string/title_activity_informatie" >
</activity>
<activity
android:name=".VriendActivity"
android:label="#string/title_activity_vriend" >
</activity>
<activity
android:name=".FoldersActivity"
android:label="#string/title_activity_folders" >
</activity>
<activity
android:name=".NieuwsActivity"
android:label="#string/title_activity_nieuws">
</activity>
</application>
</manifest>
Have you been able to launch it through ADB directly in Android Studio ?
You might want to do it this way during your implementation, it is much faster to build and test.
Just enable the developer mode in the settings and the "usb debugging" in the new menu that appeared (also in settings). You can now connect your phone to your computer and enjoy the simplicity of creating apps on Android.
Register your launchable Activity in AndroidManifest.xml like this-
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<!--______________Activities______________-->
<activity
android:name=".MainActivity" //launchable activity
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Hope this will help you.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.virginia.cs2110.finalproject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="edu.virginia.cs2110.finalproject.Splash"
android:label="#string/splash_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="edu.virginia.cs2110.finalproject.InitialActivity"
android:label="#string/title_activity_set_difficulty"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="edu.virginia.cs2110.finalproject.MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="edu.virginia.cs2110.finalproject.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
No matter what I do to the second intent-filter (change the category from launcher and action from main) my emulator always ignores the first activity's launcher! I've looked online for over 3 hours and I cannot find an answer! Please help! Thank you!
This.
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
Just could be in the first Activity than you can launch. The correct way is this.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.virginia.cs2110.finalproject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="edu.virginia.cs2110.finalproject.Splash"
android:label="#string/splash_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="edu.virginia.cs2110.finalproject.InitialActivity"
android:label="#string/title_activity_set_difficulty"
android:screenOrientation="landscape">
</activity>
<activity
android:name="edu.virginia.cs2110.finalproject.MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape">
</activity>
</application>
</manifest>
Remove the intent filter from 2nd and 3rd activity. You need only initialize it for the first time.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.virginia.cs2110.finalproject"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="19" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="edu.virginia.cs2110.finalproject.Splash"
android:label="#string/splash_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name="edu.virginia.cs2110.finalproject.InitialActivity"
android:label="#string/title_activity_set_difficulty"
android:screenOrientation="landscape">
</activity>
<activity
android:name="edu.virginia.cs2110.finalproject.MainActivity"
android:label="#string/app_name"
android:screenOrientation="landscape">
</activity>
</application>
Problem is that you are adding
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
To all the activity tags but this filter should only be for the first activity to be launched.
Just remove the filter declaration from other two activities and add it to splash activity only so that android may know splash is first to be launched...
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>
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>
Following this: http://developer.android.com/training/basics/firstapp/starting-activity.html I am confused when editing the Android Manifest.xml file. It says that the file should contain this:
<application ... >
<activity android:name="com.example.myapp.DisplayMessageActivity" />
...
</application>
My android manifest.xml looks like this:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.nick.myfirstapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="15" />
<application android:label="#string/app_name">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" />
...
</application>
</manifest>
and when I run the app everything goes fine except it says : "No Launcher activity found!
The launch will only sync the application package on the device!" Is this something missing from the android manifest.xml file?
declare Your Activity in AndroidManifest.xml as for Showing In Launcher as:
<application android:label="#string/app_name">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" >
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
see for more info how we set an activity which so in Launcher :
http://developer.android.com/reference/android/content/Intent.html
http://developer.android.com/reference/android/app/Activity.html
You need to change you manifest to the following. Doing this will tell Android that you want this Activity to be displayed in the Launcher using your icon.
<application android:label="#string/app_name" android:icon="drawable icon resource here">
<activity android:name="com.nick.myfirstapp.DisplayMessageActivity" android:label="Your Label">
<intent-filter >
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
In the docs the used ... to show that your normal code goes here. What you're doing is fine for non-launcher Activities.
You are missing the launcher intent and therefore the app finds no activity to launch at the start.
You need to lay out the activity like so:
<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>
package="com.example.myfirstapp"
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.example.myfirstapp.DisplayMessageActivity"
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>