Most voted "android-layout" questions
A layout defines the visual structure of the user interface. Normally declared in XML files, they are used by Activities and Fragments to interact with the user.
Learn more…699 questions
Sort by count of
-
2
votes0
answers398
viewsHow to modify the Navigation Drawer to call an Activity
People I created a navigation Drawer by google gallery (Navigation Drawee Activity) and would like to modify it for when I click the menu instead of calling a file extent Fragment call a normal…
android android-layout android-fragment android-activityasked 6 years, 11 months ago Maria Eduarda 63 -
2
votes1
answer3394
viewsCenter image in the middle of Android screen
How do I align an image in the center of the screen on Android? I’m using the code below, but it’s centered at the top of the screen: <?xml version="1.0" encoding="utf-8"?> <LinearLayout…
-
2
votes1
answer87
viewsLike moving two buttons around?
I’m developing an Android app that’s basically a game. In one of the Activities there are some buttons, and I wanted that when an event occurred (including the trigger of another button) two buttons…
-
2
votes1
answer66
viewsResponsiveness - Android studio
I’m having a layout incompatibility with other versions of android. on my android 8.0.0 the layout is like this On another mobile with android 4.4.2 I’m using recyclerview,grid,cardview dependencies…
-
2
votes0
answers81
viewsHow to paste an excel list to android studio and get organized with break lines?
List in excel Relacionar o item Cidade Relacionar o item Afonso Bezerra Alexandria Alexandria Almino Afonso Alto do Rodrigues Angicos Angicos Apodi Apodi How to do this in xml? Because as a long…
-
2
votes1
answer148
viewsDifferent layout for portrait(portraint) and landscape(Landscape)
I got the following: package carcleo.com.cadastro; import android.app.Activity; import android.content.res.Configuration; import android.os.Bundle; public class Principal extends Activity {…
-
2
votes1
answer32
viewsRepeated id’s in different xml layouts on Android
I am developing app and noticed that I can put the same id in two different xmls. For example: Imagine a Textview. In the 1st Layout I define your id: <TextView android:id="@+id/textViewExemplo"…
-
2
votes1
answer102
viewsMessage from "Empty Child" on an Expandable Listview on Android
I want to create a statement to the user stating that a Group of an Expansible Listview does not contain any Child (That the group is empty) as in the image below. Searching the net, I noticed some…
-
2
votes1
answer67
viewsATM simulator in Android Studio
I’m setting up a basic ATM simulator in Android Studio, where the user must enter the password, which is already pre-defined, in the case is "Java". If the password is correct, the message "Correct…
-
1
votes1
answer160
viewsWidget layout is not working
I wonder why this layout is not displayed in my widget: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"…
-
1
votes1
answer411
viewsActionbar and Splitactionbar on Android
I’m trying to create an Android application with a menu at the top and one at the bottom. Searching I found the SplitActionBar but when I use it the whole part of ActionBar is in the footer. It is…
-
1
votes2
answers473
viewsHow to call the Horizontal Keyboard when clicking on Edittext?
Explanation: I have an application that has a field of type EditText used for observation, of which it is too small, because there is no room for it. If I open the screen in "horizontal orientation"…
-
1
votes1
answer114
viewsHow to add Googlemap programmatically to a Relativelayout?
I already have all external settings performed, but my question is how to add Googlemap programmatically in a Relativelayout? Here is my Relativelayout public class Page extends RelativeLayout {…
-
1
votes1
answer229
viewsHow to disable all Textview of an Activity?
There is some method that disables all controls of a certain activity on android?
-
1
votes1
answer172
viewsIs there a tool to help optimize the layout?
It is sometimes common to doubt which layout to use, which graphic resources consume the most memory, and how to improve the layout in which the views appear. Is there any tool to help in the…
-
1
votes1
answer5276
viewsHow using actionBar appear icon + text of items?
I declared in the Manifest android:uiOptions="splitActionBarWhenNarrow" for actionBar and set the items as showAsAction="ifRoom|withText" appear at the bottom of the screen, follows the figure…
-
1
votes1
answer184
viewsHow to create "dynamic" blocks?
How to create blocks similar to the figure below, which can be created, removed, resizable (modify its size in relation to height and width) and can be placed in different places of the layout by…
-
1
votes1
answer90
viewsDistorted Layout on the Tablet
Can anyone tell if it is normal an application made for Android mobile, when run on a tablet with Android system, get distorted? Some of the Imageview of my application got distorted, some got…
-
1
votes1
answer1621
viewsHow to customize a listview (scrolling)?
Given an Activity that has an Adapter to fill a contact list: If possible wanted to get the following result as in the image below: When scrolling up and down, show the initial letter of the element…
-
1
votes1
answer1274
viewsAdd buttons to the bar action when using Listactivity?
Well I have an application that would like to keep the standard format on all screens, i have a quick access menu with some items in the action bar, and other complete in the menu option. The…
-
1
votes1
answer357
viewsHow to prevent Multi Touch from allowing touching two Listview items at the same time
I’m developing a Sales/Budgets application, and I’m having a problem with a listview custom, where the user is able to click 2 lines at once, calling 2 times the events and causing exception in the…
-
1
votes2
answers192
viewsAndroid custom listview working but having problems
Hello, I am making a Binding and I have only one of the properties of my Model that are appearing in my listview. Follow the code: Adapter: public class ProjectAdapter extends…
-
1
votes2
answers2093
viewsHow to detect screen resolution to apply the layout on android?
How to detect a certain screen size and apply the specific layout ? Example: I created a layout folder called "layout_480x800", in it will be the layouts for this resolution,I also have a layout…
-
1
votes1
answer235
viewsAndroidmanifest error on android:Theme
I’m starting in android development, I do the steps to create an app and test but always at the end of any project is an error message on android:Heme, I will post below the screen hope someone can…
-
1
votes1
answer98
viewsWhat is Actionbarsherlock for Android?
A former colleague used this framework/lib I do not know in a company project for Android and restricted the version to android 4.0+, but we need to run on Android version 2.3+... so I see no option…
-
1
votes2
answers561
viewsCreate menu button at the bottom in Google maps v2 android
How to create the Menu button equal to the Maps App. Below is an example in the red square. Someone could set an example ?…
-
1
votes2
answers1640
viewsAdd progressbar to my webview
Hello, I want to add a progress bar to my webview. I saw a tutorial and it didn’t work properly, because the progress bar keeps loading eternally. I will post the code of how it was, I wanted to…
-
1
votes1
answer891
viewsHow to set margin in a Textview in java source code?
When I’m in the xml, only applies the property: android:margin="15" I want to make the application of this same property, only, in the source code of the java, how do I do that?…
-
1
votes1
answer3898
viewsFocus Edittext Android
How do I get focus on one EditText but I’m still in trouble? I’m making a ordering system, I have 3 EditText (product, quantity and discount) and a button Add. I need that when the user click the…
-
1
votes0
answers211
viewsHow to put Action Mode on top?
I am using this property in manifest.xml: android:uiOptions="splitActionBarWhenNarrow" 1- The options menu appears at the bottom, following the figure below: 2-And when a click occurs on an item,…
-
1
votes0
answers81
viewsSearch controls in a separate class from the main activity
I need to search the controls to change values in the layout. But passing the context by parameter to the class it does not find the controls declared in xml returning null for each cast made. The…
-
1
votes1
answer47
viewsRuntimeexception (Android)
I want to put the atendenteBalaoProdutoNome on the side of AtendenteBalaoProdutoValor, thus: to do this, I tried this: attendant.xml <?xml version="1.0" encoding="utf-8"?> <merge…
-
1
votes2
answers5882
viewsHow can I place one element on the other side?
I want to put the atendenteBalaoProdutoValor on the side of atendenteBalaoProdutoNome and atendenteBalaoProduto2 below the atendenteBalaoProdutoNome. For that, I tried this: attendant.xml <?xml…
-
1
votes1
answer3184
viewsHow do I adjust my app to the screen size of multiple devices?
Good afternoon, I am developing an application in Android Studio and it is well adjusted in my Motorola Moto X 2nd Generation. However, in my Samsung Galaxy Note 3, Motorola Moto E and Motorola Moto…
-
1
votes1
answer166
viewsGroup Textviews and then access them
Example: I have 3 TextViews and its id's: TextView tv1 -> id: "um" TextView tv2 -> id: "dois" TextView tv3 -> id: "tres" I would like to group them in some way that I can access them…
-
1
votes1
answer555
viewsVisual effect when clicking the button disappears when I assign a background
I’m trying to make a simple button on an Android app. When inserting the button the effects worked normally, but after performing the background color change, the effect when clicking the button is…
-
1
votes1
answer652
viewsListview displays only one line, why?
I have a Listview in a layout with more items, and it only displays one line. If I do the same scheme in a code that the layout has only Listview it works perfectly, if anyone has any idea why I…
-
1
votes1
answer605
viewsCustom Listview occupying 100% of the screen
I created a Custom Listview with some items but as you can see in the image below is an "empty space" on the screen. I would like to know how to make the items occupy all the remaining space on the…
-
1
votes1
answer71
viewsDisable second click in Navigationdrawer
I’m developing an app, which contains a menu drawer, but I have a multitoque, that is, when the user selects an item, and quickly selects again, it keeps the drawer aberto. I would like, that when…
-
1
votes1
answer162
viewsCheckbox with Radiobutton appearance
Next bunch of you: I have an android form that has some radiobutton’s and I need that these items can be unchecked when clicked. Ex: I clicked on the first and it is marked, if I click on the second…
-
1
votes1
answer69
viewsScreen Splitting using Android + Unity
Guys, good afternoon. I have a project where I need to take a view of a particular object at 4 different points and position it in order to look something like this…
-
1
votes1
answer214
viewsAdding a Edittext dynamically and modifying the layout_width, layout_height and
I’m trying to add two Edittext dynamically, so far so good. Now as I do to move the weight property on the screen, I can only use wrap_content or match_parent.…
-
1
votes1
answer1035
viewsDoubt with style files (Styles.xml) on Android
On Android it is possible to make multiple style files, one for each version of the level of API (16, 19, 21...), for each type of screen (xxxdp) and etc. But a question arose: there is some kind of…
android-layoutasked 9 years, 8 months ago Renan Lazarotto 1,025 -
1
votes1
answer1038
viewsTela Responsivas
I’m having doubts about responsive screens on android. I’m almost done with my app, but I’m not getting it to be responsive to various screen sizes. I’m using the Android Studio IDE.…
-
1
votes0
answers87
viewssetError() overriding the Actionbar
I have a screen that the user changes their data, and as validation I use the setError() to specify which element has the incorrect value. But I have a problem when I have scroll on the screen, the…
-
1
votes0
answers86
viewsBuilt-in Activity/Fragment camera as Instagram
I have an app where sometimes the user needs to take a picture of a receipt during a confirmation process and would like to have the camera inlaid on the same screen at this time (rather than…
-
1
votes1
answer3710
viewsCenter background image
I am trying to put as background image an image that I want to be exactly centered vertically and horizontally (the image is a ball). So the goal is to stay horizontally match_parent and vertically…
-
1
votes3
answers182
viewsHow to instantiate an Activity with Edittext fields without being automatically selected?
Developing an Android application, I came across a problem, I have an Activity where there are editing fields (Edittext) in xml, and when I instate it, the first Edittext field, is selected and the…
-
1
votes1
answer625
viewsLimit of Android Layout
Good morning, I made a Layout for my last project, and agr want to expand the fields, soq for this I want the layout not to end up in the corner of the screen, I want me to slide my finger and lower…
-
1
votes1
answer468
viewsAndroid Listview equal to Instagram
I’m developing a project in Android Studio, the project screens are all made in Fragment, I’m using the Material Design followed the tutorial here, and would like to make the main screen a Listview…