Android :: How To Access An Element Present In Parent View
Oct 20, 2010
Full code. how do i access the parent activity's mail layout elements? In this case a button. I have it declared in main.xml. When a button in the listview is clicked, i want to change the text of the button in main.
View 1 Replies
Mar 20, 2010
I need to draw a child view containing a rectangle and button on top of the content view at particular location on the parent (content view). How can I do this? Did not find an explicit way to set origin of child view?
View 1 Replies
View Related
Aug 5, 2010
I have a TabActivity with two tabs-activities — FirstActivity and SecondActivity.
How can I access to any element (for example, change TextView's text) on FirstActivity from SecondActivity?
View 1 Replies
View Related
May 21, 2009
As the subject, it looks like get the windows DC in windows Mobile. How can I meet this effect?
View 3 Replies
View Related
Mar 16, 2010
I'm sure there's a simple answer to this, but...Why can't I nest another view type within a View element? In my layout file I try:
CODE:...
And this gives me a ClassCastException. Why?
View 11 Replies
View Related
Jul 31, 2010
I want to execute one method wheneer i enter number in EditText view.But i did not change the focus of EditText.I am stay in the same EditText when i enter a new number automatically i eant to execute one function.Now my question is how we find that event that means enter a new number in EditText
View 1 Replies
View Related
Sep 9, 2010
This is going to be a bit lame question. I have the following code:
CODE:.....
I have a TextView in my xml layout file. I'd like to get it and change my text when I click this button.
But I can't get it (the TextView) unless I make it as a value of a static member of this class and pass it to the constructor. I believe I am missing a big point here, so i'd be very thankful if you could explain how this is meant to be done ?
View 2 Replies
View Related
Aug 19, 2010
My friend and i develop a Android program.
Now we got to the question if it's possible to get the actual position of an ListElement.
Example: You drag the list up and down, and now you want to konw which element is on the center of the screen?
View 2 Replies
View Related
Nov 24, 2009
Does it exist an Android view equivalent to a "<select>" HTML input element ? In my application, user should fill a form. I know that ListView can display a list of elements but I think it's not relevant for a form.
View 2 Replies
View Related
Jan 29, 2010
How can I size a view based on the size of its parent layout. For example I have a relativelayout that fills the full screen, and I want a child view, say an imageview, to take up the whole height, and 1/2 the width? I've tried overriding all on onMeasu onLayout onSizeChanged etc and I couldn't get it working....
View 3 Replies
View Related
Dec 29, 2009
I am using ViewFlipper for my application. I trying to make it.when user pressed on escape (back) button, it would be back to parent Layout.
View 3 Replies
View Related
Jun 30, 2010
I want to do some cleanup in a view when the activity is being destroyed. Is there any way to get a callback in the View when the activity is being destroyed? I tried using onDetachedFromWindow, but I'm not sure whether it is correct thing to do.
View 1 Replies
View Related
Jun 20, 2010
In one of my Activities I have a ListView that displays a list of locations. For each list item I want a little arrow icon that points in the direction of the corresponding location. I implemented this icon by extending ImageView. This custom View has a listener that reacts to changes of the device's orientation by rotating the icon image accordingly. I register the listener in the onAttachedToWindow() method and unregister it in onDetachedFromWindow(). This kind of works but the problem is that onDetachedFromWindow() sometimes gets called only a long time after the containing Activity has paused. Also, the whole layout overall seems a little hacky. So my question is: Is there a proper way to unregister the listeners or would you implement this in a completely different way to begin with?
View 1 Replies
View Related
Oct 9, 2009
GridView is not behaving like it is supposed to.
This screenshot shows that the GridView (in landscape mode) is flushed left.
I want it centered. This is the XML layout for the GridView.
<Linear Layout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/templatelandscape"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<GridView
android:id="@+id/commandsbarlandscape"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1.0"
android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:padding="0dp"
android:verticalSpacing="2dp"
android:horizontalSpacing="2dp"
android:numColumns="auto_fit"
android:columnWidth="52dp"
android:stretchMode="spacingWidth"
android:gravity="fill_horizontal">
View 2 Replies
View Related
Sep 8, 2010
I have a custom Android view which overrides onTouchEvent(MotionEvent) to handle horizontal scrolling of content within the view. However, when the ScrollView in which this is contained scrolls vertically, the custom view stops receiving touch events. Ideally what I want is for the custom view to continue receiving events so it can handle its own horizontal scrolling, while the containing view hierarchy deals with vertical scrolling.
Is there any way to continue receiving those motion events on scroll? If not, is there any other way to get the touch events I need?
View 1 Replies
View Related
Oct 26, 2010
In hierarchy viewer there are several IDs as shown above, for example "id/timepicker_input".
But I can't find a respective timepicker_input - ID when typing
myNumberPicker.findViewById(android.R.id. ...? );
So how to access these Views by their ID?
View 1 Replies
View Related
Jun 30, 2010
Someone post the code for accessing .txt file available in my res folder. The code for which can be written in .java file.
View 4 Replies
View Related
Dec 8, 2009
The View class has a compute Scroll method whose documentation states: Called by a parent to request that a child update its values for mScrollX and mScrollY if necessary. This will typically be done if the child is animating a scroll using a Scroller object. See
http://developer.android.com/reference/android/view/View.html#compute...
I am using the 1.5 SDK and I do not have access from within my application to the mScrollX and mScrollY protected member variables of the View class. However, I must have a custom scroller object for my view.
View 5 Replies
View Related
Apr 19, 2010
I'm implementing custom widget exdending a View class. But I've found that View's protected field (e.g. mLeft) is not accessible from subClass
View 2 Replies
View Related
Apr 6, 2010
I'm trying to do basic authentication to view a protected url. I want to access the protected url which looks like this:
http://api.test.com/userinfo/vid?=1234. So I do the following with a WebView:
mWebView.setHttpAuthUsernamePassword("api.test.com", "", "me@test.com", "my password");
mWebView.loadUrl("http://api.test.com/userinfo/user?uid=53461");
but the authentication doesn't seem to work, I'm just getting an output error page. Am I using the WebView method correctly here?
Update:
Trying with curl: curl -u me@test.com:mypassword http://api.test.com/userinfo/user?uid=53461
and it pulls the page fine. I tried every combination of the host parameter, the owners of the api don't know what I mean by 'realm' though (and neither do I) - what info could I give them to help this along?
View 3 Replies
View Related
Mar 3, 2010
In my foo_layout.xml file I have a subclassed RelativeLayout:
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.android.myapp.FooView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/pegboard_table"
android:orientation="vertical"
android:scaleType="fitXY"
>
<ImageView
android:id="@+id/triangular"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:src="@drawable/pegboard_board"
android:scaleType="fitXY"
android:gravity="center"
android:visibility="invisible"
/>
<Chronometer
android:id="@+id/timer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/timer_display"
android:textSize="40sp"
android:textColor="#000"
android:layout_alignParentTop="true"
android:gravity="center"
android:visibility="invisible"/>
<TableLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/board_table"
android:visibility="invisible"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:gravity="center_horizontal"
android:background="@drawable/tab_bar">
<!-- android:layout_alignLeft="@id/options_tab"-->
<ImageView
android:id="@+id/game_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:src="@drawable/game_select" android:paddingLeft="15sp"/>
<ImageView
android:id="@+id/undo_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/game_select"
android:layout_weight="1"
android:src="@drawable/undo"
/>
<ImageView
android:id="@+id/settings_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/undo_select"
android:layout_weight="1"
android:src="@drawable/settings"
/>
<ImageView
android:id="@+id/info_select"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/settings_select"
android:layout_weight="1"
android:src="@drawable/info"
This doesn't seem like the right behavior. I've tried it with other views inside the FooView hierarchy and findViewById() always returns null.
For the life of me I can't figure out what I'm doing wrong.
View 2 Replies
View Related
Nov 17, 2009
Does anybody know of an app that can view Microsoft Access Snapshot (.snp) files? I think they're basic images, but a proprietary format. I haven't seen anything in the market that looks like it would do the trick. I get these emailed to me from work and would love to be able to open them on my phone!
View 1 Replies
View Related
Sep 10, 2010
I want to auto select an image in gallery and focus the selected image. I know the position (index) of the image in gallery. I am trying to use in res/layout/main.xml
<Gallery
android:id="@+id/galleryView"
android:layout_below="@id/imageViewMap"
android:layout_width="fill_parent"
android:layout_height="100sp"
android:layout_weight="1" />
in AlbumView.java
gallery = (Gallery) mView.findViewById(R.id.galleryView);
ImageView view = gallery.getItemAtPosition(position);
Unfortunately the above code is returning null. Can you please help in this matter.
View 1 Replies
View Related
Jun 9, 2010
I have google docs as part of my Gmail. How do I view these on the evo?
View 5 Replies
View Related
Jul 19, 2010
I have an EVO and I have downloaded a few things and it will only allow me to download to the sd card. Then it says download complete. My question is how the heck do i access the sd card to view it?
View 3 Replies
View Related
Oct 28, 2009
I don't know the priorities of the android team but to me this looks like a really significant bug. As reported here: http://code.google.com/p/android/issues/detail?id=2539&q=Widget&colsp.and here: http://code.google.com/p/android/issues/detail?id=3696&q =Widget&colsp.and a few other places in different wording. Apart from it not working anything like the documentation specifies, it disables two methods in the widget provider class, creates potentially huge redundancies/wasted cpu usage and pretty much makes any widget that uses a config activity a bad piece of software. Further yet, the problem with screen real estate failures (first link, my post) applies to ALL widgets, config activity or not. The entire widget framework is effected by these limbo widgets and it seems like something really small, perhaps a few lines of code to fix, considering you display Toasts and other things, the failure paths are already known, should it not just unbind these widget ids on failure? Also as a small suggestion, considering you know the minimum dimensions of the widgets before they're added, widgets could not even be shown or grayed out if the screen can not accommodate them. I notice the "Add" in the Menu does this but only when the screen is completely full, if there is any space left, a larger widget can still be chosen to add, even though it's guaranteed to fail.
View 2 Replies
View Related
Nov 17, 2010
I use opengl es 2.0 to draw some picture,and create the FBOs, but how to present the renderbuffer on the screen? code...
View 2 Replies
View Related
Oct 27, 2010
I have a file which I created and is present in data/data/com.andr.filedemo/files/a.xml. Now I want to parse this file using XML Pull parser. How can we give the path of that file or how we can access that file and then parse that file using XML Pull parser.
View 1 Replies
View Related
Aug 30, 2010
In my app i am using google maps.on clicking a pin on google map we have to get an popup at that position.but i am using custom dialog it display the message at center of the mapview.so how to display a popup instead of dialog at the position we have clicked.
View 1 Replies
View Related
Dec 23, 2009
If u have downloaded any android source code u would see a test folder present for almost all applications and base framework. I wanted to know whether we build the test code too while building sdk from source code or is it just for our reference. If it is for the latter, what is the best way to use it. Please post me the exact use of tests present in android source code.
View 2 Replies
View Related