first timer here (both in development and posting in SO). I've used idunnololz to create an animated listview for a simple reference app I'm trying to make. It's turned out really well, but after I've created it, when I run the app to test it, it now runs as AnimatedExpandableListView both in the ActionBar title and in the app drawer. I've searched here and found that you can get the app to launch with a different activity by editing the AndroidManifest.xml, so I verified that I'm pointing to my MainActivity class:
<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>
</application>
I presume this may be an issue with the MainActivity class, but maybe there's something here that I'm missing?
I found my answer here:
Android: App name shows the first page name, not the app name
<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 **NEED #string/app_name HERE**>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
Related
I have one Gallery application (A) that binds to a service.
I have second transparent application (B) that just runs a service unbound and closes itself.
sometimes - when running application B from the launcher it also runs for a split of a second the application A. I see the layout of application A appears and disappear.
I suspect that something in the manifest is defined wrong : launchMode or taskaffinty.
any ideas?
<application
android:allowBackup="true"
android:label="#string/app_name"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name="com.temp.tempApp.GalleryActivity"
android:theme="#style/AppTheme.NoActionBar"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:label="#string/app_label_gallery"
android:excludeFromRecents="true"
android:screenOrientation="portrait"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.temp.tempApp.MainActivity"
android:icon="#mipmap/ic_launcher"
android:roundIcon="#mipmap/ic_launcher_round"
android:launchMode="singleTask"
android:label="#string/app_label"
android:theme="#style/Theme.Transparent"
android:windowSoftInputMode="stateHidden|adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name="com.temp.tempApp.MainService" android:enabled="true"
android:exported="false">
</service>
Found the answer, one of the following fixed it:
1. add to each activity specific afinity value "android:taskAffinity="com.example.MainActivity""
2. different icons for the 2 activities.
hope it helps somebody in the future
I've created a :core module that stores some of my basic activities, some of these should show an actionbar, in the manifest I've something like this:
<activity
android:name=".components.home.HomeActivity"
android:theme="#android:style/Theme.Holo.NoActionBar">
</activity>
<activity
android:name=".components.activities.ContactsActivity"
android:theme="#style/AppTheme.TranslucentActionBar" >
</activity>
I don't understand why but now that I've created another module :extension that includes :core, the actionbars in that activities seems to not show.
The manifest of extension is very simple:
<application
android:name=".App"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:icon" >
<activity
android:name=".components.activities.TestActivity"
android:label="#string/title_activity_test" >
</activity>
<activity
android:name=".components.home.WelcomeActivity"
android:label="#string/title_activity_welcome"
android:theme="#style/AppTheme" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Usually this is a problem that concerns themes, but to me everything seems fine, I don't understand why it works when I build simply :core, but it doesn't work when building :extension project
I've spent too much time when the answer was easy.
Pressing Ctrl+click made me see how the theme was made, I've simply switched parent to the old layout.
<style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar">
I have a manifest with its label declared so the launcher label is different from the Main Activity (the one that is launched at start).
It was working fine, but today I saw on a friends phone it took the activity's label instead.
I have no idea what could be happening.
If it is of any help, the phone was a Motorola Razr.
Here's the relevant portion of the manifest:
<application
android:name="com.app.eventiame.EventiameApp"
android:allowBackup="true"
android:icon="#drawable/logo"
android:label="#string/app_name"
android:theme="#style/Theme.Sherlock.Light.DarkActionBar" >
<activity
android:name="com.app.eventiame.MainActivity"
android:label="#string/title_activity_main" >
<intent-filter android:label="#string/app_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
You have wrote
android:name="com.app.eventiame.EventiameApp"
instead you can just specify your app name here as below
android:name="EventiameApp"
I've made an application and the AndroidManifest.xml has these attributes:
<application
android:allowBackup="true"
android:icon="#drawable/flower"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.manish.tabdemo.TabHostActivity"
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.manish.tabdemo.HomeActivity"/>
<activity android:name="com.manish.tabdemo.AboutActivity"/>
<activity android:name="com.manish.tabdemo.ContactActivity"/>
</application>
If you look at this picture you see the main page of my app. I want to change that TabHostDemo you see next to the fire flower with MK7 VRs List.
I googled and I found that if I want to change the title I have to edit some stuff in this way:
android:label="#string/app_name"
android:label="#string/app_name"
becomes...
android:label="#string/MK7 VRs List"
android:label="#string/MK7 VRs List"
If I do this I have an error that tells me "No resources found that matches the given name". Can you help me?
go to string/app_name and change it to what ever you want
<activity
android:name="com.manish.tabdemo.TabHostActivity"
android:label="#string/app_name" >
Open res/values/strings.xml and change the value of app_name in it. Then do a clean build.
OR
or directly use android:label="MK7 VRs List"
I build a project with many activities. Every time, when I was creating new activity, I set a hierarchy parent. But I decided to make an activity with animation, which should be first. I tried to change some information inside manifest file and set the new one activity as the starting activity, but I'm doing something wrong and all the project is crushing. Ofc, I will be keep going and trying to change the manifest file, but maybe I can do that in an easier way using Eclipse tools?
--EDIT--
I solved my problem, it was a quite small mistake. I was just setting wrong layout and forget to change one more thing. I'm not a specialist yet on this topic, but maybe for other readers I will put here some information how to change the hierarchy using manifest file. If I will make any mistakes here, feel free to edit.
Ok, so let's suppose we have our project with a few activities. Inside Manifest file we can find some information about activities, this informations are between markers: . So, it may looks like:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mastermind.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="com.example.mastermind.StartGameActivity"
android:label="#string/title_activity_start_game"
android:parentActivityName="com.example.mastermind.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mastermind.MainActivity" />
</activity>
<activity
android:name="com.example.mastermind.NewActivity"
android:label="#string/title_new_activity" >
</activity>
Now we want to change the MainActivity, which is the first one and set as the first one the NewActivity. We only need to change the name of activity which contains markers:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
for the name of NewActivity and also set it's layout, like this:
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.mastermind.NewActivity"
android:label="#string/title_new_activity" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.mastermind.StartGameActivity"
android:label="#string/title_activity_start_game"
android:parentActivityName="com.example.mastermind.MainActivity" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.mastermind.MainActivity" />
</activity>
<activity
android:name="com.example.mastermind.MainActivity"
android:label="#string/app_name" >
</activity>
That should be Ok.
In the manifest file locate category.LAUNCHER:
<activity
android:name="com.example.StartActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /><!-- This -->
</intent-filter>
</activity>
<activity
android:name="com.example.MainActivity"
android:label="#string/app_name" >
</activity>
The category.LAUNCHER declares your launch Activity.