2

I am making a calendar app and I need the app icon to show the date of the month ie from 1 to 31. So how do I implement it?

What I am thinking of doing is basically having 31 activities(other than those already present) in the app like such..

<activity
        android:name="com.package.day.1"
        android:label="@string/app_name"
        android:launchMode="singleTop">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

<activity
        android:name="com.package.day.2"
        android:label="@string/app_name"
        android:launchMode="singleTop">
    </activity>

till day 31 , then in each of the days activity I would redirect to the main app using intents. This method looks very clumsy and indeed is.So my main questions are as follows -

Q1. Is it programatically possible to change<intent-filter>of the app to remove the icon from the launcher?

Q2. Is there a better way?

sayan
  • 1,520
  • 17
  • 33
  • "Is there a better way?" - Yep. Create an [App Widget](http://developer.android.com/guide/topics/appwidgets/index.html), instead of trying to change your app's icon. – Mike M. Dec 14 '15 at 10:27
  • But that won't be in the launcher. Sadly that's what I had thought of initially. – sayan Dec 14 '15 at 10:30
  • 1
    I'm not sure what you mean by "won't be in the launcher", but you might have a look at [this post](http://stackoverflow.com/questions/1103027/how-to-change-an-application-icon-programmatically-in-android), if a Widget doesn't work for you. – Mike M. Dec 14 '15 at 10:34
  • I don't want it in the home-screen , rather I want it in the app drawer.EDIT- Thanks @MikeM. the post was helpful. – sayan Dec 14 '15 at 10:34
  • Ah, gotcha. Yeah, you'll have to do it that way then. Cheers! – Mike M. Dec 14 '15 at 10:39
  • how to change like calender app? – Nikunj Paradva Dec 03 '18 at 06:25

0 Answers0