Android :: OnMeasure Gets Called / View Doesn't Change Size

Dec 3, 2009

I have a View that I've placed into a ScrollView.The View paginates text.If the text changes, then the height of this view will also change (expand or contract, depending on whether the new text takes more vertical space or less).For debugging, I draw a rectangle around the view to show its current size. After I repaginate, I cannot get Android to cause the View to change its size -- I have tried calling measure() myself, calling requestLayout(), and calling forceLayout() -- even though my overloaded onMeasure gets called, and calls setMeasuredDimension() with the correct values, the view remains the same size as it was before repagination. What am I missing?

Android :: onMeasure gets called / View doesn't change size


Android :: View Size After Orientation Change

Jun 17, 2009

Is the view aware of the orientation change in order to return updated size after a change in orientation? I'm handling the orientation myself (android:configChanges="orientation|keyboardHidden"). Does it means that I have to take into account the orientation state when querying for view.getHeight()? The view returns the same value as before the orientation change. It this the normal behavior or I should "notify" somehow the view to "refresh" its size.

View 2 Replies View Related

Android :: Way To Change Size Of Surface View On Phone?

Nov 11, 2010

I want to change the size of surface view at run time when it is changed to Landscape Mode?

View 1 Replies View Related

Android :: How To Change Size Of Bitmap Contained In ImageView / Without Affecting Surrounding View

Oct 14, 2010

I have an ImageView that contains a bitmap. Now the bitmap can change size within a known range. This makes the surrounding views to relocate which I want to prevent. I've tried setting margins and padding for the ImageView but without success.

View 1 Replies View Related

Android :: Change Text Color / Text Size In List View?

May 12, 2010

In my project I'm Multiple choice list....in this all text view in white color...i want to change text color. in program I'm use simple xml main.xml
<?xml version="1.0" encoding="utf-8"?> <RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffff00"> <List View android:id="@+id/android:list" android:layout_margin Top="2px" android:layout_marginLeft="2px" android:layout_marginRight="2px" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1"android:background="@drawable/shape_1"android:listSelector="@drawable/shape_3" android:textColor="#ffff00" android:layout_marginBottom="44px" /> </RelativeLayout> I'm ListActivity class setContentView(R.layout.main); setListAdapter(new ArrayAdapter<String>(this,android.R.layout.simple_list_item_multiple_choice, GENRES)); listView =getListView();listView.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE);

View 5 Replies View Related

Android :: How Do I Make My Image View Fixed Size Regardless Of Size Of Bitmap

Sep 23, 2010

So I'm loading images from a web service, but the size of the images are sometimes smaller or bigger than other images and the visualization looks silly when I put them in a ListView in android. I'd like to fix the size of my ImageView so that it only shows a portion of the image if it's larger than a preset amount. I've tried everything I can think of setting the setMaxWidth/setMaxHeight, setting the scale type to centerCrop, using ClipableDrawable wrapping my BitmapDrawable, setting using Drawable.setBounds(). I've tried setting in the XML and programmatically, but neither worked. I'm very surprised setting max width/height didn't do anything. Below is the XML I'm using ImageView definition in my layout file

View 1 Replies View Related

Android :: OnUpdate Doesn't Get Called On Device / Way To Fix?

Feb 14, 2010

I'm new to Android development, and I'm trying to write a small widget. This code works on the emulator and the text is set to "test", but when i run it on my Nexus One it doesn't. It just appear like onUpdate isn't called. Anyone have any good idea what i'm doing wrong?

View 1 Replies View Related

Android :: Run Query On Background Thread On Cursoradapter Doesn't Get Called?

Jul 25, 2010

I have a listactivity as a startup screen in my application. Which is displaying database records using custom cursor adapter. On create I set the filterable flag - getListView().setTextFilterEnabled(true)

My cursoradapter overrides runQueryOnBackgroundThread which runs corresponding query. The problem is that after typing some text and hitting enter, runQueryOnBackgroundThread never gets called. However, when the item click in the same view launches another activity(detail view of the record) and I come back to the original list activity, hitting back button, then text filtering works just fine. I don't call setTextFilterEnabled anywhere except during the initialization process and I can't really find any other API affecting this behavior, so any guesses why text filtering doesn't work initially, but all of the sudden starts working when I come back to the list activity from child activity?

View 3 Replies View Related

Android :: Increase View Size Of List View?

Oct 1, 2010

but no use even if try increasing the minheight....

<?xml version="1.0" encoding="utf-8"?>
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<!-- Here you put the rest of your current view-->

<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"........................

View 6 Replies View Related

Android :: Subclass Of View Constructor Not Being Called

Jun 6, 2010

I'm subclassing Android's view class, but whenever I make an instance of the view from another class, the constructor never gets called (or so it seems). I've implemented both public myclass (Context context) and public myclass (Context context, AttributeSet, attrs) I can't figure out what I'm doing wrong. Do I need to override onDraw and onMeasure?

View 1 Replies View Related

Android :: Scroll View Doesn't Resize - Content Of Child View Changes

Aug 18, 2010

I have a WebView inside the ScrollView. The content of WebView dyanamically changes when it displays different html page. I have the following issue: For example I have A.html, and B.html. The content of B.html is larger than A.html, so the page is longer. When WebView load B.html, the ScrollView stretches its size to enable itself scroll for B.html, then if I go back to A.html, ScrollView doesn't resize itself. (The scroll area is exceed the content of A.html) What I want to have, is dynamic change the scroll area of scroll view to fit the webview's content.

View 3 Replies View Related

Android :: How To Debug View In Eclipse When Intent Called?

Jun 11, 2010

I'm using Eclipse and have an emulator running Android 2.1 and my IntentService. I'd like to step through my onHandleIntent() overridden function. I've put in a breakpoint on the first statement of the function, which is Context context = getBaseContext();. When the intent is called the program just fails and does not go to debug view in Eclipse.

View 1 Replies View Related

Android :: How Get The Possition Of View In ListView That Called OnCreateContextMenu

Jun 17, 2009

I have a ListView and to create context menu I need to know what view created the menu. The View parameter of onCreateContextMenu is always the same and equals the first view in ListView. Is there any way to get position or id of view that called onCreateContextMenu?

View 2 Replies View Related

Android : Progress Dialog Went Back To First View Called It When Dismiss

Nov 3, 2009

I have a weird problem on progress dialog: I have 2 views: Login View and say, Display View. In Login View, when I click the 'Login' button, a progress dialog is created (new ProgressDialog(...)), shown and stored in a variable 'mProgressDialog'. After login, the dialog is dismissed and some information are displayed in Display View (Login View hides). Now I want to display another progress dialog when 'Update' button is clicked and when the update is done, dismiss the dialog and display new information. So I use: the Display View for a blink and then shows the Login View. I tried to change the view etc. but same problem happens over and over again. So I am thinking it might because one activity can only be assigned to ONE progress dialog and no matter how you re-create it you still get the same progress dialog. And the dialog is linked to a certain view which will be shown automatically when the dialog dismisses.

View 8 Replies View Related

Android Fragment OnDestroy Called Twice During Orientation Change?

Jan 19, 2014

why onDestroy is being logged twice for the fragment class in the the following code when the orientation of the device changes. Its logged once for the activity class, but twice for the fragment.

Code:
public class ExampleActivity extends Activity {

protected String LOG_TAG = ExampleActivity.class.getSimpleName();

private FrameLayout mFragmentHolder;[code].....

View 1 Replies View Related

Android :: Image View That Is Fixed Size Regardless Of Image Size

Nov 16, 2010

I have an ImageView which I want to always be the same size. If the image is smaller than the view, I'd like it to be centred in the view. If the Image is larger than the view then I'd like it scaled down - with aspect ratio preserved.I've had several attempts at this myself

View 2 Replies View Related

Android :: SlidingDrawer Throws RuntimeException In OnMeasure / Set It Up?

Apr 30, 2009

I would like to do some tests on SlidingDrawer however i always found RuntimeException when SlidingDrawer.onMeasure is called i check the code and think the exception is caused by unspecified MeasureSpec

so i would like to ask how to setup the MeasureSpec in SlidingDrawer?

View 2 Replies View Related

Android :: Rule That Relates OnMeasure To The Activity Lifecycle

Jul 12, 2010

I have a custom view on which I need to call a method from my activity after the view has been measured in onMeasure. I would like to know exactly when onMeasure is called in the View layout process. It looks like onMeasure is called after my activity´s onCreate, onStart, and onResume. I could override onMeasure and maintain a variable that contains whether the view has been measured or not. However it would be nice to know if there is a rule that relates onMeasure to the activity lifecycle?

View 4 Replies View Related

Android :: Prevent Runtime Exception From SlidingDrawer OnMeasure?

Jul 27, 2010

I have used sliding drawer in my code ...

When i set this as content i am getting RunTime Exception in SlidingDrarwer onMeasure!.

How can i prevent RunTimeException? Where am i doing wrong?

View 7 Replies View Related

Android :: Shared Preference Listener Being Called Multiple Times When I Change A Pref

May 31, 2010

I've written an app with 3 tabs. Each tab has the same list view with different data sources. I have setup SharedPreferences in the tabhost activity, but I put my onSharedPreferenceChangeListener method in my listactivity. When I change a preference, my listener gets called and it updates my database. This is all working. However, if I change the data in tab 1, it calls my listener once. If I change the data for tab 2 it calls it twice and if I change the data in tab 3 it calls it three times. Any idea why it works this way? I guess I could setup my shared prefs in my listactivity and that might avoid the issue, but I'm curious why my listener is called multiple times if it's in a different tab.

View 1 Replies View Related

Android :: How Can I Put Text Of Different Size In View?

Feb 26, 2009

I am making an application where i want some words to be of different size or when the user touches thy become of different size. how can i do that.

View 2 Replies View Related

Android :: Set List View Size

Mar 19, 2010

I am using List View in my project where i have used a xml file which is used to create the list item.Then i have used it programmatically in my class which is extended by ListActivity. But the problem is i have to add a button in the bottom of screen which is not related to list view but List view covers all the screen. So,is there any way to add button in bottom with list view in android.

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;.......................

View 2 Replies View Related

Android :: Set Size Of Text In List View

Aug 27, 2010

I want to set the text size of the List View. I am not use the XML Layout file. How to do this in coding?

View 2 Replies View Related

Android : Possible To Increase Size Of Hit Area For A View

Aug 10, 2010

Users are finding it difficult to register clicks on text links ...is there any way I can increase the hit area for a given view?

View 4 Replies View Related

Android :: Maximum Text View Size Settings?

Mar 13, 2009

I am looking for setting the text view max text size. Can any one help me how to set that?

View 2 Replies View Related

Android :: Size A View Based On Its Parent's Dimensions?

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

Android :: Animate View And Stay In New Position / Size?

Jul 27, 2010

I currently have a view in my Android app and the view is playing a frame animation. I want to animate the view to increase its size to 150%. When I apply a scale animation to it, and the scale animation is completed, I want the view to stay at that new size for the rest of the activities life cycle. Unfortunately right now when the scale up animation is complete, the view snaps back to the original size. How can I get it to keep the new animated tranformation? I'm using myView.startAnimation(AnimationUtils.loadAnimation(mContext,R.anim.scaleUp150));

View 3 Replies View Related

Android :: Practical Limit To Size Of Large View?

Jan 27, 2009

Let's say I use a ScrollView to pan over a very large view. The large view draws itself dynamically in onDraw(). Is there a practical limit to the size of the view? That is, are view contents cached or buffer-backed and can I turn that off?

View 2 Replies View Related

Android :: How To Determine View Size Right After Activity Has Been Started?

Feb 19, 2010

I want to do some data processing (in a thread) right after my main Activity starts. For that data processing to be started I also need to know a visible size of my main View (which is a LinearLayout currently, but whatever).I wonder how to do that. I.e. I wonder what is the entry point (callback?) I should use to be sure that my main View has been layed out, so i can use view.getWidth/getHeight? Is creating a custom View and reimplementing it's onSizeChanged() - the only way? In this case how should I properly describe it in my xml layout file? (it will contain some child views)

View 1 Replies View Related

Android : Reduce List View Font Size

Aug 29, 2009

How can we reduce list view font size?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved