190 questions
0
votes
1
answer
65
views
Buttons layout to be rearrange after hiding any one so fill the first row first
I have six button in two Linear Layouts, three in each linear layout. But If I hide any button from any Linear layout they are rearranged accordingly in the same linear layout. But I required the If I ...
1
vote
4
answers
803
views
Kotlin Android: 'TelephonyCallback' detect phone number
To be honest, I've searched a lot on the subject, but since is a lot of changes on latest API it is still not clear for me if it is possible somehow to get the phone number of the caller.
The main ...
0
votes
1
answer
35
views
Android XML layout to BMP Issues with width and rendering
I'm having a tough time getting this XML layout to BMP, found similar post here: Converting a view to Bitmap without displaying it in Android?
But nothing in there has helped me; my view.measuredWidth ...
1
vote
1
answer
766
views
Render problem in layout xml - Android Studio
When I am trying to add a TextView in layout xml, the rendering of views does not occur and the design tab becomes empty.
This is the stacktrace shown in Studio
Render problem
java.lang.reflect....
0
votes
1
answer
66
views
How do I resolve the 'missing xml-layout' error in Android?
Whenever i open a new empty activity this shows up.
I tried syncing with gradle .
I also tried invalidating caches..
I rebuild the project many times but still facing this issue.
7
votes
1
answer
9k
views
How to import AndroidViewBinding in jetpack compose
I'm trying to use some fragments within jetpack compose but I can not import AndroidViewBinding from (androidx.compose.ui.viewinterop) and it is always appearing as an unresolved name
how to import it ...
0
votes
2
answers
2k
views
How to add chip to edit text in Android Studio [closed]
I found a dependency that I thought might help me, and it looked promising. But when I try to implement it I get a
"Failed to resolve: com.hootsuite.android:nachos:1.1.1" :
https://i.sstatic....
0
votes
0
answers
67
views
How to include an outer XML layout in Android
We are re-designing our Android app and I have created the basic layout in a XML file. I am planning to re-use the same layout in multiple activities but I'm not sure how to include this in a new ...
0
votes
1
answer
206
views
Setting color of marked text of textfield
I was looking for an answer, but I wonder why nobody asks this kind of question. Maybe I just formualted it wrong.
Basically, the only thing I want i to change the marker color from Purple->Orange, ...
2
votes
2
answers
635
views
Layout in Android Emulator looks different as compared to the layout file
I have recently started learning Android Development. I am using Android Studio and I created the XML layout file with it. But the layout is looking different on the emulator to the one I created on ...
5
votes
0
answers
416
views
Update to Constraint-Layout 2 destroys working layouts
After updating com.google.android.material:material and androidx.constraintlayout:constraintlayout from 1.1.0 and 1.1.3 to 1.3.0 and 2.0.4 my layout gets squished. I've got a custom view constraint-...
0
votes
1
answer
88
views
Android: RelativeLayout disables clickable Imageview button
in my android app, I use a simple screen with an MPandroidchart wrapped in a RelativeLayout and a back button at the top. The button does not respond.
The button (clickable imageview) does work as ...
0
votes
1
answer
304
views
What is the shortcut for switching XML view?
Can anyone tell me how can I switch between these 3 tabs using keyboard shortcut?
Earlier it was working with
alt + shift + left/right arrow
But now with android studio's new version, it is not ...
0
votes
0
answers
295
views
Make view scroll out of the window (Like Twitter profile layout) android xml layout
I want to have twitter-profile-like layout. My xml is as follows :
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://...
1
vote
1
answer
266
views
Android Studio 3.6 Canary 12 XML layout doesn't resolve
I have updated my Android studio to latest version and I am facing some issues.
When I create a package and inside the package I create an empty activity, for some reason it doesn't recognise the R....
0
votes
4
answers
583
views
How to Place a Button below a ListView in a Scrollable Activity?
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:...
0
votes
1
answer
185
views
Custom view onTouch breaking onTouch in other views if added using XML layout
I'm developing a game, and I have a custom view Joystick which haves a onTouch event. I also have a ImageView which also haves onTouch for shooting.
If I add the views programatically using java code ...
2
votes
1
answer
528
views
Android | ScrollView | height wrap_content
How does Android think about ScrollViews?
I come from webdev background, so that is my paradigm for implementing a scrolling element.
Yet on Android, official tutorials and docs say, I should use ...
-1
votes
1
answer
142
views
How to make classes in android-studio to use the same root layout but with different text shown on TextViews
I am a beginner and this is my first app.
I am making an app that will show the user Text View in the mainActivity.xml, ex.Music, then the user can click on the 'music' text View(via intent) , and it ...
0
votes
1
answer
290
views
How to I prevent squeeze of item inside layout during scale animation?
I am using scale animation in Android relative layout , where I have a button and need to scale it to small size at one end .
I have used scale animation and it works fine , but it does have an icon ...
0
votes
1
answer
79
views
Define view to be scrolled over in xml at start
I load a smiliar layout when my fragment starts:
<ScrollView
android:layout_height="wrap_content"
android:layout_width="match_parent">
<LinearLayout
android:layout_width=...
5
votes
1
answer
3k
views
Placing an image on the top left of another image using Constraint Layout
I'm trying to place an icon top left of an image using Constraint Layout but it needs to be offset from the center of its sides. Like in the pictures:
This is what I've got so far:
This is the ...
-1
votes
1
answer
204
views
Android BlackScreen Layout after showing Activity
After starting the application on mobile , the Layout background go to black after changing from one activity to another
NOTE : the origin color of the layout is White
this is the screen-shot :
...
0
votes
1
answer
943
views
Google Blogger XML Layout Error For Designing Theme
I want to divide the Header area into two parts (No - Logo & No - Ad Area) using Google Blogger XML Layout.
When I trying to save my XML codes the Blogger HTML Editor is showing an error --
The ...
-4
votes
1
answer
91
views
Different layouts for single activity [duplicate]
I want to create different view states for error and success of login page. For that I want to create the singe activity (login), Which will have email and password fields. After submitting the data ...
2
votes
2
answers
2k
views
Can't find DatePicker in XML layouts
In previous Android studio version I used DatePicker but now in 3.1 version doesn't exist anything as the same.
Is it any replacement for that?
5
votes
2
answers
2k
views
Enabling both errorEnabled and passwordToggleEnabled in a TextInputLayout
I want to set both errorEnabled and passwordToggleEnabled to true in a TextInputLayout, but it seems that these two can't coexist because the one covers the other like this.
I want to do this because ...
8
votes
1
answer
5k
views
How to use viewpager inside nestedScrollView with a view top of viewpager
I am unable to scroll nestedScrollView because of viewpager. So let me explain here is layout design that i want to create:
There is FrameLayout inside NestedScrollView and a viewpager with tab ...
1
vote
1
answer
827
views
Android keyboard push up all the content
I have a layout that looks like this .
When i click on the editText the screen keyboard push up all the content.
I want the header (orange area) to stay fixed and shown in the top of the screen.
The ...
0
votes
1
answer
149
views
Custom shaped button in android
I want to create a custom shaped button like this:
I'm able to achieve a similar thing by using a RelativeLayout and overlapping a rectangle and a circle. But that way, I have to add 2 ...
1
vote
2
answers
84
views
Layout stays blank
I have added an ImageView and two TextFields to my Layout but when I look in the preview it just stays blank. It gives me the error "Rendering error". What can I do?
I will add my Layout file in the ...
3
votes
1
answer
2k
views
How to customize spinner box?
I want spinner as dropdown like below images,
I created below like this
xml layout:
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
...
-1
votes
1
answer
104
views
How to fit the tab above of the screen when scrolling the page?
I want to design the screen. layout, tab and grid view I want to scroll option. In scroll time, fix the tab on the header (Below of status bar) and grid view scroll to end of grid view content. In the ...
1
vote
4
answers
688
views
Android Toolbar moves up when keyboad show
I have an issue with soft keyboard on my project.
I have a chat screen with one EditText ,listview and a send button in my Activity.Whenever Edittext get focus It moves up the toolbar and layout.
i ...
1
vote
3
answers
249
views
Baseline Constraint in Linear, scrollable layouts
I need to make sure that two view elements are right next to each other and vertically at the same height. I'd do it using Baseline Constraint but currently I'm working with a linear, scrollable ...
1
vote
1
answer
1k
views
RecyclerView's height not adjusted when the AppBarLayout is expanded
The code for initializing the RecyclerView
private void initRecyclerView() {
layoutManager = new GridLayoutManager(this, spanCount);
mRecyclerRV.setLayoutManager(layoutManager);
...
1
vote
2
answers
896
views
My Button is not responding in android studio
When i run the app. The buttons refuse to respond. I set a Toast and a logcat to check for response. but non. please help resolve
this is my source code
<TextView
android:layout_width="...
2
votes
2
answers
478
views
Nested Recyclerview of Images not clicked
As shown in image it have recyclerview of list and each recyclerviews item has again new recyclerview which contains list of images. the red area is getting captures click event but from same item ...
-1
votes
1
answer
1k
views
Android Layout xml "buttons stacking" (newbie )
I just started with android development. I just need a screen with some buttons on it that can contact a webserver, to trigger an action there, but i have not even gotten that far.
When i add buttons ...
-2
votes
2
answers
47
views
Layout overwriting
I have an arrow image in listview on right hand side. The text from other holders is overwriting on it. How can i keep a gap or space between arrow and justify all text. I was looking to configure it ...
0
votes
1
answer
440
views
How to load large xml layouts faster in android
I have a xml layout that contains almost 60 TextViews, 30 EditText, 60 CheckBoxes and some background xml shapes for form designing.
Now my Activity is taking 2-3 seconds to load on lollipop with 2 ...
0
votes
0
answers
63
views
android studio migrated code binary xml issue coming
I have done successfully for eclipse code to android studio migration. for past two weeks. that code is working fine.but, suddenly, the home page( landing page, contains 10 menu options available with ...
2
votes
1
answer
3k
views
Suspicious size this will make the view invisible (in child layout)
I have a child LinearLayout inside a LinearLayout
the inner Layout is showing a message saying
Suspicious size this will make the view invisible
I have set the orientation of the layouts the ...
4
votes
2
answers
2k
views
How to design Chips layout for long text
I want go design chip layout like below.
When Text is short enough to fit withing the layout I want to view like this.
When Text is too long to fit in I want it display like this and animate text ...
0
votes
1
answer
50
views
Android : onTouch event trigger movement of other object.
I am developing an android application with custom layout as below with a button on left hand side of the screen by default on load of the page.
When user clicks swipe button from left to right. The ...
0
votes
0
answers
130
views
Image look pixelated in recyclerview
I am trying to make a simple recyclerview with image on left and text on right so i gave image width and height of 70dp both and i used png image 1000x1000 exported from illustrator using export for ...
0
votes
2
answers
477
views
Android: Two-line list view with radio buttons, can’t select items
I would like to display a list of paired Bluetooth devices and let the user select one. I’m trying to create a two-line list view (one line for the friendly device name, the other for the MAC address) ...
0
votes
1
answer
377
views
Layout preview and actual device do not match
I don't know why this is happening. I bet it's something real simple but I could not figure out why. I have a comment activity with a Relative Layout as a parent and a RecyclerView as well as a Linear ...
2
votes
2
answers
2k
views
Reusing Fragment or layout files
I am making an English education app that has an activity that uses viewPager to return a number of fragments. The app will have additional units which use additional activities that use viewPager to ...
1
vote
0
answers
187
views
Disable XML layout changes on preview touch (Android Studio 2.2.2)
On the Android Studio 2.2.2, every time I barely touch or click the preview layout of an XML layout file, it does change and I will have to revert those changes. Is there a way to disable that?