Strange issue when installing .apk file in samsung galaxy tab - android

I have a strange issue.
I have my .apk file in my mac machine and i sent that file to my Galaxy Tab via bluetooth. when i installed that file, that app gets installed but i get many instance of the same app...
Also when i unintsall the app, all the app instances gets deleted
As i am a newb in android development, please help me out to solve this issue.
Thanks for any help
This is my manifest file
<application android:icon="#drawable/co_logo" android:label="#string/app_name">
<activity android:name="com.co.sampling.Loading"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.CoDb"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Login"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.OrderPrompt"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.New_Order_Screen_1"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.New_Order_Screen_2"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.Enrich_Order"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.Customer_Feedback"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.Prompt"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.Enrich_Order"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.Enrich_Order_List"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.PopupMenu"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.co.sampling.Order_NewOrder_2"
android:theme="#android:style/Theme.NoTitleBar"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:configChanges="orientation|keyboardHidden" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

These lines
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
should be present only in the main activity tag. Remove from all other activity tags.
Adding this intent filter indicates that this activity is the main activity of the app and should be listed in the launcher(apps drawer)

And I would add that the android:label should only be present on the application tag, not anywhere else.

Related

Error running wear default device not found

I've created an android application and am now getting an "Error running wear, default device not found" error message. I can't think of anything I have done or changed that has made this start.
I have closed Android studio and re opened it
I've invalidated the caches and restarted
I've run a lint check
Looked at this question Android Studio cannot find default activity
Still no joy however.
My manifest is below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.james.testing">
<uses-feature android:name="android.hardware.type.watch" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#android:style/Theme.DeviceDefault">
<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=".ScrollingActivity"
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=".SimpleGridActivity"
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=".Drinks"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.DayNight.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Food"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.DayNight.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Fitness"
android:label="#string/app_name"
android:theme="#style/Theme.AppCompat.DayNight.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</>
</manifest>
Try changing the theme to something basic for now and see if it works.

No Launcher Activity Found even though there is [duplicate]

This question already has answers here:
No Launcher activity found
(2 answers)
Closed 9 years ago.
This is a copy of my AndroidManifest.xml
Any help as to why the launcher is not being recognized? I tried running the code without applying DEFAULT to any other activity but it's still not working.
enter code here
<application
<activity
android:name="project.shirsho.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="project.shirsho.MENU" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="project.shirsho.MAINACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.Textplay"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.TEXTPLAY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
You need to specify the MAIN and LAUNCHER in the the intent filter for the activity you want to start on launch by :
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
if you want that Splach Activity as your launcher , your manifest must be :
<application>
<activity
android:name="project.shirsho.Menu"
android:label="#string/app_name" >
</activity>
<activity
android:name="project.shirsho.MainActivity"
android:label="#string/app_name" >
</activity>
<activity
android:name="project.shirsho.Splash"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="project.shirsho.Textplay"
android:label="#string/app_name" >
</activity>
</application>
I believe that you are trying to make "project.shirsho.Menu" as the launcher activity, then it should be like:
<activity
android:name="project.shirsho.Menu"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
change,
<intent-filter>
<action android:name="project.shirsho.MENU" />
to
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Hope this helps! :)
This is how your application part should look like. If you use eclipse to develop in it will help you create this (androidManifest.xml)
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<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=".SplashActivity"
android:label="#string/app_name" >
<intent-filter>
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

my application has stopped unexpectedly in android please try again

I have an error in my android code:
case R.id.bSQLOpenView:
Intent i = new Intent("com.fps.say.SQLView");
startActivity(i);
break;
and my logcat says there's no activity found to handle intent..
I already declared my class at AndroidManifest.xml why do i still get this error.
this is my manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fps.say"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk android:minSdkVersion="10" />
<uses-permission android:name="android.permission.SET_WALLPAPER"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name" >
<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.fps.say.MENU" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".SayActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.fps.say.SAYACTIVITY" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".TextPlay"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.fps.say.TEXTPLAY" />
</intent-filter>
</activity>
<activity
android:name=".Email"
android:label="#string/app_name" >
<intent-filter>
<action android:name="com.fps.say.EMAIL" />
</intent-filter>
</activity>
<activity
android:name=".Camera"
android:label="Camera Application"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="com.fps.say.CAMERA" />
</intent-filter>
</activity>
<activity
android:name=".AboutUs"
android:label="#string/app_name"
android:theme="#android:style/Theme.Dialog">
<intent-filter>
<action android:name="com.fps.say.ABOUTUS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Prefs"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.PREFS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name=".Data"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.DATA" />
</intent-filter>
</activity>
<activity
android:name=".GFX"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.GFX" />
</intent-filter>
</activity>
<activity
android:name=".GFXSurface"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.GFXSURFACE" />
</intent-filter>
</activity>
<activity
android:name=".OpenedClass"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.OPENEDCLASS" />
</intent-filter>
</activity>
<activity
android:name=".SoundStuff"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SOUNDSTUFF" />
</intent-filter>
</activity>
<activity
android:name=".Slider"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SLIDER" />
</intent-filter>
</activity>
<activity
android:name=".Tabs"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.TABS" />
</intent-filter>
</activity>
<activity
android:name=".SimpleBrowser"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SIMPLEBROWSER" />
</intent-filter>
</activity>
<activity
android:name=".SharedPrefs"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SHAREDPREFS" />
</intent-filter>
</activity>
<activity
android:name=".InternalData"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.INTERNALDATA" />
</intent-filter>
</activity>
<activity
android:name=".ExternalData"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.EXTERNALDATA" />
</intent-filter>
</activity>
<activity
android:name=".SQLView"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SQLVIEW" />
</intent-filter>
</activity>
<activity
android:name=".SQLiteExample"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.fps.say.SQLITEEXAMPLE" />
</intent-filter>
</activity>
</application>
</manifest>
There are several possible ways to run an activity.
Here's the method I use:
Intent i = new Intent (this, YourTargetActivity.class);
startActivity(i);
The this corresponds to your current activity.
Using such a call gives you the convenience to have your IDE autocomplete the desired activity name.
Dubble check the name of the class
Dubble check the name which should be mentioned in the manifest file
Perform a clean-build
Intent i = new Intent(this,SQLVIEW.class);

Help on Tab Layout example

New bee to Android, I need help on creating tabs.
I am following the example stated in http://developer.android.com/resources/tutorials/views/hello-tabwidget.html
When I run the application, I am not seeing any tabs but only Songs tab.
I am not able to figure out how to resolve this.
Below code is added under AndriodManifest.xml
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
</activity>
<activity android:name=".AlbumsActivity">
<intent-filter>
<action android:name="com.example.TabWidget.AlbumsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".ArtistsActivity">
<intent-filter>
<action android:name="com.example.TabWidget.AlbumsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity android:name=".SongsActivity">
<intent-filter>
<action android:name="com.example.TabWidget.AlbumsActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Make it look something like this:
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".HelloTabWidget"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".AlbumsActivity"/>
<activity android:name=".ArtistsActivity"/>
<activity android:name=".SongsActivity"/>
</application>
This part:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
is for the entry part of your app.
here is a very simple example for tab-layout:
Andorid Tab-Layout with icons

Android app icon shows on device to allow uninstall but does not allow to execute

I am able to run an android app in two virtual devices when degugging.(Galaxy tab and phone). When I close the app in debug mode the icon is not showing in the virtual device.
The same thing occurs when I load a signed .apk file to the actual devices.
The app icon shows when I go into manage applications. I can uninstall the app. Thats all I can do. I cannot launch the app since the icon is not visible with the other app icons.
I am using platform 2.2 with google api's 8.
What am I doing wrong? How can I get the app icon to show with other apps and be able to launch?
Here is my manifest file.
Any help is appreciated.
<uses-permission
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.INTERNET">
</uses-permission>
<uses-permission
xmlns:android="http://schemas.android.com/apk/res/android"
android:name="android.permission.ACCESS_FINE_LOCATION">
</uses-permission>
<uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
<application
android:label="#string/app_name"
android:icon="#drawable/appicon"
android:name=".ApplicationController"
android:debuggable="true" >
<uses-library android:name="com.google.android.maps" />
<activity android:name=".MainActivity"
android:screenOrientation="portrait"
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=".MainFlippingActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MainFlipping" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".PrefsTabWidget"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.PrefsTabWidget" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".PrefsTaskingActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.PrefsTasking" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SatelliteSelectionActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.SatelliteSelection" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="MainSettingsActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MainSettings" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="ClassificationActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.Classification" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="ListItemPrefActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.ListItemPref" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="TimeOnTargetActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.TimeOnTarget" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="LatLonActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.LatLon" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="QuantityActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.Quantity" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="IncidenceAngleActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.IncidenceAngle" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="SendUrlActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.SendUrl" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="TestActivity"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.Test" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="Slide"
android:screenOrientation="portrait"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.Slide" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="8"/>
You should only be using <category android:name="android.intent.category.LAUNCHER" /> for one of your activities, not all of them. Try removing all others except the one that goes with <action android:name="android.intent.action.Main" />
EDIT: I may be wrong but I think you'll also need to capitalize MAIN as in <action android:name="android.intent.action.MAIN" /> for it to be recognised as the 'main' entry point (main activity).
Try to remove "android.intent.category.LAUNCHER" for each activity because android project must have only one LAUNCHER activity.
try to this if your main activity use this
<intent-filter>
<action android:name="android.intent.action.Main" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Other activity you can use this
<intent-filter>
<action android:name="android.intent.action.(your action )" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
I think it can be helpful to you .

Categories

Resources