Questions tagged [xml-layout]

Android uses xml files to layout its components on a window.

Android uses xml files to layout its components on a window.

187 questions
1
vote
2 answers

Set Alpha/Opacity of Layout of widget

I want to set the opacity of background of LinearLayout, I found this solution that works fine if I use normal layouts, but in the case of android-widgets we have to set layout different I wrote the following code public class AlphaLayout extends…
Muaz Usmani
  • 1,298
  • 6
  • 26
  • 48
1
vote
1 answer

how to initialize a custom surfaceView given that its a nested class in an activity?

I have a custom SurfaceView that looks like this: public class GFXSurface extends Activity implements OnTouchListener { . . GameSurface gameSurfaceView; @Override protected void onCreate(Bundle savedInstanceState) { …
Leon
  • 55
  • 1
  • 8
1
vote
3 answers

Errors creating view for custom view

I created a Custom View class that takes a path, then fills it white and colors its edge red: StrokeFill.java: package com.kf.pathshape; ... public class StrokeFill extends View{ private Path shapePath; public StrokeFill(Context context, Path…
tangfucius
  • 444
  • 7
  • 14
1
vote
3 answers

My Android Crash when i add a new layout

Hi every body i'm currently trying to solve a strange problem. I reduced as mush as i could my app to show you clearly the problem. I can launch my app with the main layout just like this: public class AndroidReaderActivity extends Activity { …
Bobyblanco
  • 123
  • 12
0
votes
1 answer

layout looks good in android layout editor - completely off on emulated devices

For example: I'll do a layout (using the editor) for the galaxy tab. When I run galaxy tab emulator my circles will be strewn all around the its "screen". If I do a layout for a smaller phone and then run the phone's emulator, I get the same results…
user465001
  • 806
  • 13
  • 29
0
votes
1 answer

How to replace android:inputType="none" in Code

I was expecting something like editText.setInputType(InputType.TYPE_NONE), but there is no such variable as TYPE_NONE. Can any body help me. It might be a simple question. I am using Android 2.1.
Muhammad Nabeel Arif
  • 19,140
  • 8
  • 51
  • 70
0
votes
1 answer

Lost EVERYTHING in my Android app in Eclipse?

I closed the main.xml Layout file in Eclipse, and all of the sudden, this is what I get: No XML content. Please add a root view or layout to your document All of the xml code is gone, the Graphic Layout editor is gone, and I can't get anything…
Cole
  • 2,805
  • 9
  • 44
  • 61
0
votes
1 answer

Android: How to create such layout dynamicaly (not by xml)?

In My application i want to create the layout as like below image: So How to make it possible ? I have done Something like below code: public void showResult() { List textListWord = new ArrayList(tempEmployerList.size()); …
Shreyash Mahajan
  • 23,386
  • 35
  • 116
  • 188
0
votes
2 answers

Nullpointerexception when findingViewById

I have nullpointerexception in last line of my oncreate method public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); …
simekadam
  • 7,334
  • 11
  • 56
  • 79
0
votes
1 answer

How to make the custom xml layout for this android project?

I am trying make application from this project: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/graphics/FingerPaint.html But here, there is a Layout that generating dynamicly. I want to create my own layout in…
0
votes
1 answer

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.
0
votes
0 answers

layout width attribute match_parent is not working while using ListAdapter

I am using recycler view to to populate the data on the screen. I am using List Adapter instead of using Recycler View Adapter and Below's code as a ListItem3 Layout.
Meet Soni
  • 23
  • 4
0
votes
0 answers

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 activity and change just the inner contents (inside…
AndroidDev
  • 5,193
  • 5
  • 37
  • 68
0
votes
1 answer

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, but I can't find the correspondive android:…
0
votes
1 answer

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 intended, if I change the RelativeLayout into…