Closed tomasz1986 closed 4 years ago
Hmm... My fdroid client shows:
They parse the app manifest and somehow pickup the secondary launch activity instrad of the one marked as primary. Feel free to report it to fdroidserver repo at gitlab. I cannot solve this from my side.
Thanks for your help
This happened to my app like 10 months ago after I added a second launcher activity. As you've discovered, the name is taken from the wrong activity when there is more than one activity with a launch intent-filter
.
I found a work around by adding an activity-alias
that pointed to my second activity, and moving the launch intent-filter into that. As an added bonus, this also made it possible to toggle the second launcher icon of/off using an option.
Hi, could you please post the relevant manifest xml part so I could look at it?
Sure. I've copied the relevant parts of my manifest into this gist.
To toggle the alias on/off at runtime, I'm using the following from inside a CheckBoxPreference's onPreferenceChange
listener:
ComponentName componentName = new ComponentName(context, "com.forrestguice.suntimeswidget.alarmclock.ui.AlarmClockActivityLauncher");
int state = (Boolean)newValue ? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED;
PackageManager packageManager = context.getPackageManager();
packageManager.setComponentEnabledSetting(componentName, state, PackageManager.DONT_KILL_APP);
I'm not sure that feature is actually useful (but there it is).
@forrestguice Thank you. Do I get this right that I just have to add the following part "alias" for my main activity (which should be the default and is NOT the camera launcher)?
Toggling on off the secondary (camera) launcher activity already works in Syncthing-Fork.
<activity-alias
android:name=".alarmclock.ui.AlarmClockActivityLauncher"
android:targetActivity=".alarmclock.ui.AlarmClockActivity"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.app.shortcuts"
android:resource="@xml/shortcuts_alarms" />
</activity-alias>
Hrm, I think the other way around. Leave your main activity alone. Add an alias pointing to the camera launcher that contains the intent-filter
<activity-alias
android:name=".activities.PhotoShootActivityAliasOrWhateverYouWantToCallIt"
android:targetActivity=".activities.PhotoShootActivity"
android:enabled="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
and remove the intent-filter from the camera activity itself
<activity
android:name=".activities.PhotoShootActivity"
android:icon="@mipmap/ic_launcher_photoshoot"
android:label="@string/photo_shoot_launcher_title"
android:launchMode="singleInstance">
</activity>
F-Droid will only discover the main activity (it overlooks the alias) and should take the right name.
Seems to be ok "by its own" now. https://f-droid.org/de/packages/com.github.catfriend1.syncthingandroid/ https://f-droid.org/en/packages/com.github.catfriend1.syncthingandroid/
and on the f-droid app it is okay on my test android, too.
Description of the issue
F-Droid seems to pick up "Sync. Camera" as a name of the whole application. I do not think this is intended, is it?
Website:
F-Droid app store:
On the application installation screen, it is still Syncthing-Fork.