Trying to test a widget.The Widget appear in the widget tab when I click on it, I get app is not installed toast message in Emulator
I don't really understand how widget works , so one more sub-question : I followed http://kasperholtze.com/android/how-to-make-a-simple-android-widget/ tutorial -> now I have this source code , perhaps I need to run it even once from an activity , how the code is compiled into the widget anyway?
Below is the manifest.
<receiver
android:name=".TimeWidget"
android:label="Time" >
<intent-filter>
<action android:name="android.intent.action.AIRPLANE_MODE"/>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/time_widget_provider" />
</receiver>
<activity
android:name="com.example.ass3.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=".ConfigurationActivity" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<activity android:name="IncCallHistory" android:label="Incoming Call History"></activity>
<activity android:name="TimeWidget" android:label="Time Widget"></activity>
</application>
Related
Here is my manifest:
<application
android:allowBackup="true"
android:icon="#drawable/toto"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:process=":app_process">
<activity
android:name=".core.Main"
android:label="app_label"
android:launchMode="singleTask"
android:alwaysRetainTaskState="true">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.nfc.action.TECH_DISCOVERED" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.nfc.action.TECH_DISCOVERED"
android:resource="#xml/nfc_tech_filter" />
</activity>
<service android:name=".core.MessengerService"
android:enabled="true"
android:process=":app_process">
<intent-filter>
<action android:name="My_Messenger_Service"/>
</intent-filter>
</service>
<receiver
android:name=".core.BootReceiver"
android:enabled="true"
android:label="StartMyServiceAtBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
My launcher breaks after reboot phone, then the phone asks me to choose the default launcher which contains Android default launcher and my launcher.
I tried to get logcat by using command line:
adb logcat -d > logcat.txt
But I didn't find any error log E/ of my launcher. How can I trace this error?
Can someone helps me pls? Thanks,
I added this param and it worked
android:clearTaskOnLaunch="true"
after install my app on my device, she runs without problems, but when i want to access the app from the home menu apps, the icon doesnt appear, i look into aplication manager and the app is installed, I read others responses about that but cant figure it out, heres my manifies file.
<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="majad.sunshine.app"><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" />
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="geo"/>
</intent-filter>
</activity>
<activity
android:name=".DetailActivity"
android:label="#string/title_activity_detail"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="majad.sunshine.app.MainActivity" />
</activity>
<activity
android:name=".SettingsActivity"
android:label="#string/title_activity_settings"
android:parentActivityName=".MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="majad.sunshine.app.MainActivity" />
</activity>
</application>
<uses-permission android:name="android.permission.INTERNET" /></manifest>
Ill appreciate your help please
you missed an intent filter tag
<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"/>
<data android:scheme="geo"/>
</intent-filter>
This will solve the problem.You are giving two actions in the same intent filter which was causing the problem.
When I launch my app with Eclipse, I get this error :
No Launcher activity found!
launch will only sync the application package on the device!
However, the AndroidManifest seems correct :
<application
android:name="com.myapp.MyApplication"
android:allowBackup="true"
android:largeHeap="true"
android:icon="#drawable/icon"
android:label="#string/name"
android:theme="#style/myTheme" >
<activity
android:name="com.myapp.OpeningActivity"
android:theme="#android:style/Theme.Holo.NoActionBar"
android:label="#string/name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/myxml" />
</activity>
<receiver android:name="com.myapp.MyBootReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.parrot.intent.action.LAUNCH_NAP_APP" />
</intent-filter>
</receiver>
</application>
I can't see anything worst in this code.
Note that with AndroidStudio, this error not appears. So... is Eclipse the problem ?
Thank you for your help.
Whenever I try to run my App, it installs two app in the emulator/device. I only want to Install my Main Activity, but the Splash Activity installs also. I know the problem is in the Manifest. Can anyone help me please? Here is my code:
<activity
android:name="com.android.upcurrents.launcher.SplashActivity"
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="com.android.upcurrents.MainActivity"
android:label="#string/app_name" />
You need to have only one activity to be declared as the launcher. So, remove the intent-filter from within the SplashActivity's tag, and add it to your MainActivity. The Launcher intent-filter should be present in only one of the activities in your manifest file.
It installs based on the intent filter you have provided.
Remove the following intent filter from SplashActivity and then put it in Main Activity
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
try this:
<activity
android:name="com.android.upcurrents.launcher.SplashActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="com.android.upcurrents.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>
I had this same problem but I fixed it with the making sure you only have one activity with:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
In my code I had two activities with that intent-filter, which caused two applications to be installed on my device.
We have the same problem but i fixed it this way
before my code below in manifest
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
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>
</application>
Notice that in the SplashActivity inside the intent is this code
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
i only deleted the category
<category android:name="android.intent.category.LAUNCHER" />
So after i deleted the intent-filter category in splash it didn't install two app icon but only one for main the code will be like this notice that the intent-filter category is deleted
<application
android:debuggable="true"
android:allowBackup="true">
<activity android:name=".SplashActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
</activity>
<activity
android:name="com.noupdate.apptest_noupdate.MainActivity"
android:icon="#drawable/ic_launcher"
android:theme="#android:style/Theme.NoTitleBar"
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>
it really helps
In my app I have the main activity defined in the manifest.xml file like this:
<activity
android:name=".MainActivity"
android:label="#string/guide_activity" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="#xml/searchable"/>
</activity>
when I run the project from eclipse connected to a real device or an emulator I receive the following message in the console:
No Launcher activity found
what can be the reason of this ?
Split the intent-filter into two seperate ones. If you mix them like this, android won't determine that one of the two is the launcher filter.
<activity
android:name=".MainActivity"
android:label="#string/guide_activity" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data android:name="android.app.searchable"
android:resource="#xml/searchable"/>
</activity>