Unable to override the Launcher Icon - android

I want change the existing App Icon. I follow steps App Folder->Create New->Image Asset->Asset Type(Image). When I upload a new icon, it's not allowing me to go Next screen. I can only see the warning 'Icon with the same image already exist' but no specific error. In my other project I can easily override the same icon. Please guide where I am missing?

Related

Highlight the Menu Item found in Search Result of Android Settings App

Inside Android core Settings App, when we search anything in the search bar, then the result of that search is highlighted automatically.
For e.g. please see below image where I highlighted my application name in the Notification Access section.
I achieved this by following code:
val intent = Intent("android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS").apply {
val app = "${application.packageName}/${NotificationListener::class.java.name}" //Here NotificationListener is a service name
val fragmentKey = ":settings:fragment_args_key"
val showFragmentKey = ":settings:show_fragment_args"
putExtra(fragmentKey, app)
putExtra(showFragmentKey, Bundle().apply { putString(fragmentKey, app) })
}
I referred to the Solution on this LINK
However, I want to highlight my application name in the Usage Access Setting.
i.e. when I open the intent for Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS) then inside the list of apps, my app name must be highlighted.
However the above logic/approach is not working for Usage Access Screen.
My application opens the intent but does not highlight my app name there.
I did a detailed research but I am still facing challenge.
Hence, I request you all to please assist.
For ACTION_USAGE_ACCESS_SETTINGS , I can't find one. Have you seen it anywhere? If so, please show me on which app. I've requested about this here:
https://issuetracker.google.com/issues/165311852
https://issuetracker.google.com/issues/160303945
And one in general, for all settings:
https://issuetracker.google.com/issues/163176781
As for notification-access, check here: stackoverflow.com/a/63914445/878126

"_Problem loading widget" in release version only

I've a really weird behavior with the App widget:
I've a home screen widget with a ListView showing data from internet.
It's working fine with no problem at all on the debug version,
but when I install release:
when I drag the widget to the home screen it shows "problem loading widget" and in the Logcat:
E/ResourcesManager: failed to add asset path /data/app/com.askelp.askelp-u7QWKA4gT6KmeGou17fWHw==/base.apk
E/RemoteViews: Package name com.askelp.askelp not found
BUT if I left it in the home screen and reinstalled the app it works then, and if I removed the widget from the home screen and reinstalled it again and dragged it again to the home screen it shows the same error and "problem loading widget"
Anyone has any idea?
EDIT:
I tried now to run it on my phone it's working, so it's working on my phone but not working in the emulator!
Solution1 :
Have you try to invalidate cache/restart?
Solution 2:
From the Documentation Link , You can only use this as widgets
A RemoteViews object (and, consequently, an App Widget) can support the following layout classes:
*FrameLayout
*LinearLayout
*RelativeLayout
*GridLayout
And the following widget classes:
*AnalogClock
*Button
*Chronometer
*ImageButton
*ImageView
*ProgressBar
*TextView
*ViewFlipper
*ListView
*GridView
*StackView
*AdapterViewFlipper

Android Facebook SDK - action.setPlace Error in Custom Stories in Andorid(Feed Dialog Method)

I am trying to post a FB Custom story in Android using Open Graph(Share Dialog Method). The code was working very well and posted successfully, until I had added action.setPlace(). Now the Share dialog is appearing correctly. But when I click the 'POST' button, a wierd error message comes as follows
"We are Sorry, this post is no longer available. It may have been removed"
And in onActivityResult(), I get the following exception "com.facebook.FacebookException: Error publishing message"
Here is my code
OpenGraphObject place = OpenGraphObject.Factory
.createForPost("shellstationstunisia:shell_gas_station");
place.setProperty("title", "Shell Stations Tunisia");
place.setProperty(
"image",
"http://img1.wikia.nocookie.net/__cb20070306105202/uncyclopedia/images/4/4e/Shell_Logo.png");
place.setProperty(
"url",
"http://www.shell.com/global/aboutshell/contact-us/contact/contact-tunisia.html");
place.setProperty("description", "Best Gas Station in Tunisia");
OpenGraphAction action = GraphObject.Factory
.create(OpenGraphAction.class);
action.setProperty("shell_gas_station", place);
//Set a Place - THIS CAUSED THE PROBLEM - Place ID is correct
GraphPlace my_current_location = GraphObject.Factory
.create(GraphPlace.class);
my_current_location.setId("432170683497784");
action.setPlace(my_current_location);
#SuppressWarnings("deprecation")
FacebookDialog shareDialog = new FacebookDialog.OpenGraphActionDialogBuilder(
this, action, "shellstationstunisia:travel",
"shell_gas_station").build();
uiHelper.trackPendingDialogCall(shareDialog.present());
I solved the problem by myself. It was an Authentication issue. I had to enable 'Place' Capabilites from FB Developer Panel. Just follow the steps given below,
In developers.facebook.com, open your app dashboard.
In the Left pane, open 'Open Graph.
Select 'Action Types' tab
Select the Action type for which your getting the above mentioned error.
Scroll down to the section and you will find 'Capabilities' Section
Turn ON 'Place' or any other capability which you would like to use
Click Save Changes.
Now your app would work fine :)
I solve this problem by this way:
Open your "Settings" - "Display Name"
Change "Display Name" into your app name (must be the same)
Hope this can help you!

Recent Apps on UiAutomator

I am now working with Android UiAutomator on for UI Test on my Android app. My app has a function that requires the user to verify the email to continue, so I try to do it like this: after reach to that function -> getUiDevice.pressHome -> Browser -> try to log in email -> PressHome again -> Press RecentApps then I stuck here, I cannot press on my Apps to return to it again. I try another way by clicking on my App icon but it starts my app again, not at the state before. Can anyone suggest me a solution for this? Any help is appreciate.
Thanks in advance.
Try this :
UiObject appBackground = new UiObject(new UiSelector().description("ABC"));
appBackground.click();
It did not show any description through 'uiautomatorviewer' command but this worked for me.
I could manage to create this behavior with:
fun backgroundAndForeground() {
val device = UiDevice.getInstance(getInstrumentation())
device.pressHome()
// Pressing app switch two times makes the last app put on background come to foreground.
device.pressKeyCode(KeyEvent.KEYCODE_APP_SWITCH)
device.pressKeyCode(KeyEvent.KEYCODE_APP_SWITCH)
}
In this case, I think that android only resume app when clicking the recent app image. It does not work on clicking display text or app icon. So, we need to click image of your app in recent app list. At that time you need to write as below. I always do that for similar case.
// Take all image view by class type and click by instance no.
new UiObject(new UiSelector().className("android.widget.ImageView").instance(3)).click();
You need to count instance no of your recent app image view. Not app icon image in recent app scroll view. Please try this. Thanks.
I've spent half a day on this and concluded I needed to issue a device.click(). Since my use-case is that my app was the last one running (not switching to the browser like you), I can safely click the middle of the screen and it'll always work.
If you're the 2nd to last running app, you can probably do x: 0 and y: device.displayHeight/2.
I've not tested this on many operating systems, only 9.

Android icon wrong in App Management app, but correct in Launcher

I have a simple Android app (built with Mono for Android), which has a problem with it's icon.
The icon is correct in Launcher and in Task Switcher, but
In Manage Apps and in Task Manager it's displayed a generic Android icon
I've checked the various density resources and the manifest and they all look correct.
(I'm seeing this on a Galaxy S phone and on a Nexus 7)
Most likely you set the icon property for your activities within AndroidManifest.xml, but did not set it for the application.
It occurs to me, that the app icon is somehow being cached in the app manager, so that deinstalling and reinstalling the app does not always change the icon properly. Rebooting the device could help.
Also i found this post very useful: adding application ids in gradle usually solves the problem.
Open "AndroidMenifest.xml" in the Package Explorer and click on the "Application" tab at the bottom. Look at the "icon" field and enter the location for your icon ( Ex: #drawable/iconimage). Next, go into the "AndroidManifest.xml" tab and look for android:icon=, adding the location to that as well (Ex: android:icon="#drawable/iconimage)
Make sure you have the same icon name in both locations!
Oleg and Collin are both right but for completeness - in a Mono app the icon can be set with attributes on the Application object (if you have one):
[Application(Label = "MyAppName", Icon = "#drawable/icon")]
class MyApp: Application
{ ...

Categories

Resources