Layout icon auto generated activity - java

I am currently using android studio 2.3.3 with Kotlin and I dont know why these icon are automatically generated (you can see the picture below). Normally I have only one icon. The four icons are exactly the same when I click on it

Related

Why does the preview change when I click show layout decorations button in android studio?

I have designed the front end for my application it looks fine in the preview but when i click "show layout decorations" button the total preview is being disturbed! i am not able to get proper output.
can someone check this out? this is for my school project.[preview before pressinf "show layout decorations"preview after clicking show layout decorations
this issue has been solved in the new Android Studio update
Update your android studio to the latest version and it should work...
You can simply use the shortcut key to check for your version and know if you could update...
Simply tap Shift twice then in the small box...input About to check for version and update to update your ide to the latest version...this should work.
Cheers

Libgdx android icon not being applied

I made a game and now I want to change the icon, so I replaced the icons on res/drawable (with the same file name). But when I run the game on my android phone it still installs with the default libgdx icon and not my own icon. Then I tried to change the icon names and also making changes in my manifest file.
<application
android:allowBackup="true"
android:icon="#drawable/loh_icon" //loh_icon.png is my icon name
android:label="#string/app_name"
android:theme="#style/GdxTheme" >
Still the same problem, how can my game still have the default libgdx icon? I deleted those icons and replaced them. I also invalidated my intellij caches and restarted.
If you look in your android/res folder, you'll see 5 different directories starting with drawable. The part after the dash is the screen density.
Inside each folder there is a file called ic_launcher.png with a size for each screen density. This is why by default, you'll find this in your manifest: #drawable/ic_launcher. You'll need to make different resolutions for different densities, and replace them.
You can use this online tool to automatically do it for you: Android Asset Studio.
Make your icon and click the download link. Open the ZIP file, and extract it to your res folder.
You can delete the drawable folders. Go into your manifest, and set your icon to: #mipmap/ic_launcher
In Android Studio just right click over android/res -> new/image asset, on dialog choose icon_laucher and the radiobox for image, there you can select whichever image you want. Android will make all different images for you
Some phones will cache app icons. This means that it might keep showing you the old app icon even after you change it.
Try restarting the phone. Alternatively, you can try changing the theme of the phone if it has such an option (e.g: MIUI)
Android API 26 introduced adaptive icons:
https://developer.android.com/guide/practices/ui_guidelines/icon_design_adaptive
libGDX provides new files that handle this. Use the libGDX setup wizard to generate a blank project to see it. The files are stored in:
android/res/drawable-apydpi-v26
You can edit ic_launcher_foreground.xml and ic_launcher.xml to set it up for API 26+ devices.

How to add Android Device Monitor to Main Toolbar in Android Studio?

I'm following Udacity's Developing Android Apps class, and in their video it shows an icon at the top of Android Studio for a shortcut to Android Device Monitor. My shortcut icon is not there so I had to search to find it.
I'm trying to add it to the toolbar by right clicking and going into "Customize Toolbars and Menus" but I can't find anything. I googled multiple different things and can't seem to find the answer. Not sure if this is a recent change from Android Studio updates.
Is there a way to add this to the top toolbar? Thanks!
fortunately it is :)
open the customize menu and toolbars by right clicking the toolbar.
Navigate to Main toolbar-Android.MainToolBarSdkGroup and then click Add after... (in fact you can choose whatever position you like most).
Then simply choose All actions-Main menu-Tools-Android-Android device monitor
Profit – robot is there :)

Screenshot is not supported below API 14

I am trying to get a screen shot of the android studio emulator running on API-10. Unfortunately I am getting the following message:
Can anyone explain why is that so and is there any other easy workaround to this except Print Screen (since it does not produce the same image quality and one needs to crop the image manually)?
The solution has been within the Android Studio itself:
1- Click on Android Device Monitor
2- On the left, there is a tab named Devices . Find your emulator name and click on it.
3- In front of the Devices tab there are a set of icons. Find the Screen Capture icon and click on it.
4- After the Device Screen Capture window opens, wait until your emulator's current screen is captured.
5- At last, you can save the quality image by clicking on the Save button.

android google maps button on popup

Okay. What I have so far is an Android app with a Google map on which I've placed a bunch of icons that, when clicked on, create a popup with some text on it. Is there any way to place a button on that popup? If this is not possible, is there some way to make a button appear when an icon on Google Maps is selected?
In case you're wondering, the code I'm using now looks like this.
itemizedOverlay.addOverlay(new OverlayItem(point, title, text));
//actually a whole bunch of OverlayItems, each with their own location and text
//but this is the general shape of it.
mapOverlays.add(itemizedOverlay);
Edit:
There are different kinds of popups used with different versions (check yourself in the emulator versions) of the GoogleMaps app. The first popup simple displays the title of the location (Android 2.3.3).
The second popup shows the title and arrow indicator. (Android 4.0.3)
Interesting enough: I noticed that both popups are clickable and start another activity that shows details about the location.
The mapviewballon project https://github.com/jgilfelt/android-mapviewballoons/ allows you to use your own custom layout for these popup.
I did not test with buttons on it but I do not see why I would not work.
The example projects shows the following types of popup balloons.
Here is another project that creates a custom popup balloon. The project can be downloaded at the end of the article.

Categories