Redirect to concreate activity with notifications - android

I'm using Notifications in Android. When the user clicks them, I have to open the application and redirect him to one specific Activity, it works fine if the user who gets the notifications didn't have the application opened. (I mean, opened in background), if he has the application opened, when he clicks the notification he is redirected to the "Main" activity when I want to redirect him to the same activity.
I guess that it could be some mistake in my AndroidManifest.xml,, but, I'm not sure, could you someone help me??
My manifest:
<application
android:screenOrientation="portrait"
android:debuggable="true"
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen">
<!-- android:theme="#style/AppTheme" android:theme="#android:style/Theme.NoTitleBar.Fullscreen" -->
<activity
android:name="com.trivialword.activities.MainDisplayActivity"
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.trivialword.activities.ResultActivity"
android:label="#string/title_activity_result"
android:theme="#android:style/Theme.Light.NoTitleBar.Fullscreen" >
</activity>
And here is where I configure the notification
Context contexto = context.getApplicationContext();
CharSequence title = "Trivial Invitación";
CharSequence description = "Invitacion a una partida del usuario " + msg;
Intent notIntent = new Intent(contexto,
GameOnePlayerPrivateOnlineActivity.class);
notIntent.putExtra("opponent", true);
notIntent.putExtra("who-create-game", msg);
PendingIntent contIntent = PendingIntent.getActivity(
contexto, 0, notIntent, 0);
notif.setLatestEventInfo(
contexto, title, description, contIntent);
Thank you!.

In intent declaration, try to write this.
http://developer.android.com/guide/topics/ui/notifiers/notifications.html
Creating a simple notification:
// Creates an explicit intent for an Activity in your app
Intent resultIntent = new Intent(this, ResultActivity.class);
I think, that is the problem.

Related

Android - Adding an Intent to a notification

I'm new on android development and I still don't understand Intent very well. Here i'm using Firebase to create notifications, I add an Intent to my notification, but when my app is in foreground and I click on the notification nothing happens (when the app is killed or in background it work well).
The strange thing is at a moment it was working, when I clicked on the notification the function "onNewIntent" of my "MainActivity" class was called, but now nothing happen anymore, and I think I changed nothing on the code.
Here is how I create my intent :
Notifications notifs = new Notifications(this);
String title = remoteMessage.getData().get("title");
String body = remoteMessage.getData().get("body");
String url = remoteMessage.getData().get("url");
Intent intentNotif = new Intent(this, MainActivity.class);
intentNotif.setAction(Intent.ACTION_MAIN);
intentNotif.addCategory(Intent.CATEGORY_LAUNCHER);
intentNotif.putExtra("url", url);
intentNotif.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP);
//intentNotif.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
notifs.showNotif(title, body, true, intentNotif);
Here is how I add the intent to the notification :
this.builderGeneric.setContentIntent(PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT));
I also tried to create an intent with a custom action but it's not working, I tryed different intent flags, but I feel like i'm trying random things without knowing what I do, so that's why I'm asking for your help.
EDIT :
Here is how I create the notification if it's usefull :
Notifications(Context context) {
this.context = context;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
this.notifManager = context.getSystemService(NotificationManager.class);
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_LOW);
channel.setDescription(CHANNEL_DESCRIPTION);
channel.enableLights(false);
channel.enableVibration(false);
channel.setSound(null, null);
if (this.notifManager != null) {
this.notifManager.createNotificationChannel(channel);
}
} else {
this.notifManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
}
this.builderGeneric = new Notification.Builder(context)
.setVisibility(Notification.VISIBILITY_PUBLIC)
.setWhen(System.currentTimeMillis())
.setSmallIcon(R.mipmap.ic_launcher_round);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
this.builderGeneric.setChannelId(this.CHANNEL_ID);
}
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.LOLLIPOP) {
this.builderGeneric.setSmallIcon(R.mipmap.ic_launcher_foreground);
}
}
public void showNotif(String title, String text, boolean cancelable, Intent intent) {
this.builderGeneric.setContentTitle(title)
.setContentText(text)
.setOngoing(!cancelable)
.setContentIntent(PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_UPDATE_CURRENT));
Notification notifGeneric = this.builderGeneric.build();
this.notifManager.notify(1, notifGeneric);
}
EDIT 2 : Here is my manifest :
<application
android:allowBackup="true"
android:fullBackupContent="#xml/backup_descriptor"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:launchMode="standard"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".MainActivity"
android:configChanges="orientation|screenSize">
<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" />
</intent-filter>
</activity>
<receiver
android:name=".NetworkChangeReceiver"
android:label="NetworkChangeReceiver">
<intent-filter
android:name=".NetworkIntentFilter"
android:label="NetworkIntentFilter">
<action
android:name="android.net.conn.CONNECTIVITY_CHANGE"
tools:ignore="BatteryLife" />
<action android:name="android.net.wifi.WIFI_STATE_CHANGED" />
</intent-filter>
</receiver>
<service android:name=".MyFirebaseService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
</application>
OK, First try to remove
intentNotif.setAction(Intent.ACTION_MAIN);
intentNotif.addCategory(Intent.CATEGORY_LAUNCHER);
Next, adding android:launchMode="singleTask" (also removing android:launchMode="standard") inside your activity tag in AndroidManifest.xml.
Then try again, please aware that with the launchMode is singleTask and if you click on your notification while your MainActivity is opened -> onNewIntent will be triggered (because Android will not create one more instance of this Activity) otherwise onCreate will be called.
And if it works, I would like to recommend you to read more about LaundMode here

Not Navigating back to MainActivity

When I click on Notification I should be navigated to Main2Activity and when I click on back button of Main2Activity I should be navigated back to MainActivitybut I am getting navigated back to Home screen.
Is there any mistake in my code?
NotificationCompat.Builder noti = new NotificationCompat.Builder(MainActivity.this);
noti.setContentTitle("Message for you!");
noti.setContentText("Hi!!This is message for you");
noti.setSmallIcon(R.drawable.ic_launcher_background);
noti.setTicker("app name:message app");
noti.setAutoCancel(true);
Intent intent = new Intent(MainActivity.this,Main2Activity.class);
TaskStackBuilder taskStackBuilder=TaskStackBuilder.create(MainActivity.this);
taskStackBuilder.addParentStack(MainActivity.class);
taskStackBuilder.addNextIntent(intent);
PendingIntent pendingIntent=
taskStackBuilder.getPendingIntent(1234,PendingIntent.FLAG_UPDATE_CURRENT);
noti.setContentIntent(pendingIntent);
Notification notification=noti.build();
NotificationManager notificationManager = (NotificationManager)
getSystemService(NOTIFICATION_SERVICE);
notificationManager.notify(1234,notification);
Mainifest.XML file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sainathpawar.notifications">
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Main2Activity"
android:parentActivityName=".MainActivity">
<intent-filter>
<action android:name="second_filter" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
Please try this
<activity
android:name=".Main2Activity"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value=".MainActivity" />
</activity>
It is because you are not within a stack. You only launched one activity. Your default MainActivity has not been created or launched.
You can handle the back button press with android.R.id.home in the OnMenuItemSelected callback and redirect them wherever you would like. You can try the "parent activity" route as well, but I'm not certain how that works when launched from notification without context of the parent to launch it to begin with.
If you go that route, update to let us know if it worked for you.
Otherwise you can easily use my answer as well.
EDITED FOR CLARITY
#Override
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case android.R.id.home:
startActivity(Main2Activity.this, MainActivity.class);
return true;
finish();
}
return super.onOptionsItemSelected(item);
}
taskStackBuilder.getPendingIntent(1234,PendingIntent.FLAG_UPDATE_CURRENT);
noti.setContentIntent(pendingIntent);
There was error in coding at above line.If we see here the requestcode is 1234 which is same as ID of notify method
notificationManager.notify(1234,notification);
so it was navigating back to Home screen because Android OS was thinking as if its on MainActivity because of 1234 request code in getPendingIntent.
****Solution is:****change requestCode of getPendingIntent() method from 1234 to any random number I changed it to 0 and it worked for me.
You can achieve this by PendingIntent without TaskStackBuilder as:
Intent parentIntent = new Intent(this, MainActivity.class);
parentIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
Intent resultIntent = new Intent(this, Main2Activity.class);
final PendingIntent pendingIntent = PendingIntent.getActivities(context, 0,
new Intent[] {parentIntent, resultIntent}, PendingIntent.FLAG_UPDATE_CURRENT);
noti.setContentIntent(pendingIntent);

Every intent starts a new task in Android App - how to prevent?

In my application I have several "intents" that I use to transition between different activities in my application. I have noticed a strange behavior that occurs on Samsung devices - but not on Nexus devices - whenever a new intent is created the application launches a second "task" for this new activity! When the user goes to the multi-tasking menu they can see multiple copies of the application! This is not the desired behavior. Any and all advice would be greatly appreciated!
Manifest:
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:launchMode="singleInstance">
<activity
android:name=".MainActivity"
android:screenOrientation="portrait"
android:launchMode="singleInstance">
</activity>
<activity
android:name=".Settings_area"
android:screenOrientation="portrait" />
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="AIzaSyDieXTCaFoIL0kJ_IM4UMBSQL3sNn92AWM" />
<activity
android:name=".MapsActivity"
android:label="#string/title_activity_maps" />
<activity android:name=".Splash"
android:launchMode="singleInstance">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".aboutPageActivity" />
<activity android:name=".turnOffFromNotification"
android:noHistory="true"></activity>
</application>
I have already attempted removing the launch modes as well as changing the application launch mode to singleTop and standard.
Intent that creates a second instance:
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
new Handler().postDelayed(new Runnable(){
#Override
public void run() {
/* Create an Intent that will start the Menu-Activity. */
Intent mainIntent = new Intent(Splash.this,MainActivity.class);
Splash.this.startActivity(mainIntent);
Splash.this.finish();
}
}, splashDisplayLength);
return;
}
Intent that creates a third instance:
public void goToAboutPage()
{
Intent goToAboutPage = new Intent(this, aboutPageActivity.class); //create the intent to go to the map screen
startActivity(goToAboutPage); //actually go to the map screen
}
A third instance can also be created from launching a settings intent:
public void changeToSettingsScreen() //changes the screen to the setting screen
{
readyToSendPackets = false;
sendSwitch.setChecked(false);
// textView.setText("NOT sending"); //set the textview to advise users packets are not being sent
Intent goToSettings = new Intent(this, Settings_area.class);
startActivity(goToSettings);
}
I also over rode the onNewIntent Method:
protected void onNewIntent(Intent intent) {
// super.onNewIntent(intent); //REMOVED THIS TO AVOID DOUBLE INSTANTIATION ON TOUCHWIZ IF ANYTHING BREAKS LOOK HERE FIRST
setIntent(intent); //this allows us to recieve the extras bundled with the intent
// System.out.println("Here is the bindle: " + getIntent().getExtras());
if (getIntent().getExtras() != null) //check to see if there are any extras, there wont be on apps first start
{
Bundle extras = getIntent().getExtras(); //get the extras
String methodName = extras.getString("methodName"); //assign the extras to local variables
if(methodName != null && methodName.equals("turn_send_switch_off"))
{
sendSwitch.setChecked(false);
}
//else if(**other actions that may need to be performed can go here**)
}
Thank you very much for any help!!!
Usually if you have to force a single instance of the app, you should avoid putting android:launchMode="singleInstance" on each activity seeing as it would try to launch an instance for each activity.
Removing the launchMode from everything except the application should ensure that only the application runs in a single instance, although what #Shaishav said is true, most of the time you can let android deal with the lifecycle of an application by not setting the launchMode, unless you have a real need to ensure only one instance is running at a time.

GCM push notification is not showing in some devices when app is not running

I am implement GCM Push Notification in my app and its successfully done but in some devices it not show notification when app is close.
List of device which notication is not show:
Redmi-2
lenovo
Gionee
Can anyone explain me what is problem and how i solve its.
here my manifest:-
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="student.skoolstar.android.catalyst.com.schoolstar.skoolstarstudent">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<permission
android:name="student.skoolstar.android.catalyst.com.schoolstar.skoolstarstudent.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="student.skoolstar.android.catalyst.com.schoolstar.skoolstarstudent.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.VIBRATE" />
<application
android:name="student.skoolstar.android.catalyst.com.schoolstar.skoolstarstudent.Controller"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/MyMaterialTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Login"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".ListOfClass"
android:screenOrientation="portrait">
</activity>
<activity
android:name=".EditProfile"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".ShowStudentList"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<receiver
android:name="student.skoolstar.android.catalyst.com.schoolstar.skoolstarstudent.GcmBroadcastReceiver"
android:permission="com.google.android.c2dm.permission.SEND" >
<intent-filter>
<!-- Receives the actual messages. -->
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="schoolstar.com.catalyst.android.skoolstar" />
</intent-filter>
</receiver>
<service android:name=".GCMNotificationIntentService" />
<activity
android:name=".Message"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".Attendance"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".NewMessage"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".GroupMessage"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
<activity
android:name=".Test_Chat"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateHidden">
</activity>
</application>
</manifest>
here my service name GCMNotificationIntentService:-
public class GCMNotificationIntentService extends GCMBaseIntentService {
public static final int NOTIFICATION_ID = 1;
private NotificationManager mNotificationManager;
NotificationCompat.Builder builder;
Database db;
private Controller aController = null;
public GCMNotificationIntentService() {
// Call extended class Constructor GCMBaseIntentService
super(Constants.GOOGLE_SENDER_ID);
}
public static final String TAG = "GCMNotificationIntentService";
#Override
protected void onRegistered(Context context, String registrationId) {
}
#Override
protected void onUnregistered(Context context, String registrationId) {
Log.d("unref",registrationId);
if(aController == null)
aController = (Controller) getApplicationContext();
Toast.makeText(getApplicationContext(),"hello no",Toast.LENGTH_LONG).show();
aController.displayMessageOnScreen(context,
getString(R.string.gcm_unregistered));
aController.unregister(context, registrationId);
}
#Override
public void onError(Context context, String errorId) {
Log.d("error","");
if(aController == null)
aController = (Controller) getApplicationContext();
aController.displayMessageOnScreen(context,
getString(R.string.gcm_error, errorId));
}
#Override
protected void onMessage(Context context, Intent intent) {
if(aController == null)
aController = (Controller) getApplicationContext();
aController.acquireWakeLock(getApplicationContext());
String message = intent.getExtras().getString("message");
String formuser = intent.getExtras().getString("formuser");
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT+5:30"));
Date currentLocalTime = cal.getTime();
DateFormat date = new SimpleDateFormat("HH:mm a");
date.setTimeZone(TimeZone.getTimeZone("GMT+5:30"));
String localTime = date.format(currentLocalTime);
db = new Database(context);
int from_id = 0;
List<FetchData> fetchdata = db.getAllContacts();
for (FetchData fd : fetchdata)
{
from_id=fd.getID();//get ser no
}
db.storeMessage(420, formuser, from_id + "", message, "text", localTime, "F", "ST", "R");
aController.displayMessageOnScreen(context, message);
// notifies user
sendNotification(context,message);
}
private void sendNotification(Context context,String msg) {
String app_name = context.getResources().getString(R.string.app_name);
mNotificationManager = (NotificationManager) this
.getSystemService(Context.NOTIFICATION_SERVICE);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
new Intent(this, ListOfClass.class), 0);
Uri alarmSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(
this).setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle(app_name)
.setStyle(new NotificationCompat.BigTextStyle().bigText(msg))
.setContentText("New Message")
.setSound(alarmSound);
mBuilder.setContentIntent(contentIntent);
mNotificationManager.notify(NOTIFICATION_ID, mBuilder.build());
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP, "TAG");
wl.acquire(15000);
// Log.d(TAG, "Notification sent successfully.");
}
}
When I am see the whatsapp, hike and others notification app he will always run in background thread but my app is not running always in background. So may be this reason be also.
I am recently working on android please help me.Thanks in advance!
I faced similar issue with Redmi-2. There is no problem in the code but it is due to Custom UI provided by the Manufacturer like MIUI 6.
So to enable GCM notifications
Go to Security App >> Tap on permissions >> Tap on Auto Start and enable auto start for your App.
There are two major reasons for that
1 - Some devices does not allow you to run a service on background like redmi-2 ( almost on all xiaomi device ). Even whats app could not work properly on them unless user allow them by going to Security App >> Tap on permissions >> Tap on Auto Start and enable auto start for whatsapp etc. In this case all you can do is to show the details of this to user on application start up. And open that screen and guide user ( if possible ) like clean master.
2- Second reason is that it didn't work on one of those phone whose Google Play Services app wasn't installed correctly(and its essential for GCM). You can not do anything on these devices also. The only thing you can do in this case is just show some message to user about this.
So from my experience there always be a number of users(but very small percentage) who wont receive GCM push.
There is concept of whitelisting in Xiaomi's phone. So, if you put log in onReceive of gcm, you will notice that gcm is receiving but it's not processing further. Its cause your app is not whitelisted.
Xiaomi for security purposes disables the Notification for each Application. Follow these steps to receive messages in background once they quit the app using cleaner.
Enable Autostart
Enable Floating and Lock Screen Notification
Enable AutoStart
Open Security App.
Got to Permissions, then Click on Auto Start Management.
Add/Enable auto start apps (e.g. Whatsapp).
Enable Floating and Lock Screen Notification
Open Settings App.
Click on Notifications, then click on Manage Notifications.
Tap on the App which you are looking for (e.g. WhatsApp).
Enable Show in notification shade / Show on lockscreen and in drop down option.
For Reference check this out : http://support.hike.in/entries/55998480-I-m-not-getting-notification-on-my-Xiaomi-Phone-For-MIUI-6-
i got success with this.. Hope it helps..
Facing the same issue, the only things we did are to educate xiaomi users to do the steps as #anup-dasari mentioned, and set the gcm priority to high, with possibility to have persistent service in the future

how to set Activity Title in Intent?

In TabHost we can do getActionBar().setTitle("ACTITIVTY TITLE").
But what about in the intent?
Is there possible way to set title in intent?
code
Intent i = new Intent(MenuActivity.this, DrawerListActivity.class);
startActivity(i);
Toast.makeText(getBaseContext(), "RF number: " +
KEY_RFnumber, Toast.LENGTH_SHORT).show();
MainActivity.class
public void send(View view) {
Intent intent = new Intent(this, DrawerListActivity.class);
String message = "Drawer Title";
intent.putExtra("key", message);
startActivity(intent);
}
DrawerListActivity.class, in onCreate()
String message = getIntent().getStringExtra("key").toString(); // Now, message has Drawer title
setTitle(message);
Now, set this message as Title.
You can't set the title directly with the intent. You could pass along the title in the intent, and have your target activity extract the title from the intent and set it. This would only be a few lines of extra code in the target activity.
I got it! I just declare from my MainActivity a public static String that holds a string which I set in my Intent, then it call to my DrawerListActivity. It works perfectly! Thanks.
i just paste another person answer regarding this question may be it will help you
<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_full" >
//This is my custom title name on activity. <- The question is about this one.
<intent-filter android:label="#string/app_launcher_name" > //This is my custom Icon title name (launcher name that you see in android apps/homescreen)
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

Categories

Resources