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?

Android :: SlidingDrawer throws RuntimeException in onMeasure / Set it up?


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 :: Attempt To Stub Android Activity Class Using PowerMockito Throws RuntimeException - Stub

Sep 17, 2010

I found this example where they used PowerMock and EasyMock to stub/mock the Menu and MenuItem classes for android. I have been trying to do something similar with PowerMock and Mockito with the Activity class.

I understand that a lot of the methods are final and that in the Android.jar they all just throw RuntimeException("Stub!").

I also understand that this test isn't complete but I just wanting to see if it is possible to mock the android Activity class.

But given that PowerMock allows you to mock classes with final methods shouldn't this code work?

CODE:............

I would think that the RuntimeException would no longer occur and "Title" would be returned but it still throws the exception.

I have tried all sorts of different things like doReturn("Title").when(mockActivity).getTitle(); and suppress(constructor(Activity.class));

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 :: 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?

View 2 Replies View Related

Android : How To Get SlidingDrawer Widget?

Dec 1, 2009

Has anyone used the sliding drawer widget? I'm trying to get the widget to slide out from top to bottom, but right now it only seems to support bottom to top or right to left. Any suggestions on how to get it to slide out from the top?

View 2 Replies View Related

Android :: Make A SlidingDrawer For Application?

Nov 1, 2010

I've looked in many places, but I cant find a decent tutorial on how to make a SlidingDrawer for my application.

Say i already have an XML file, and i want to add a sliding drawer to it..i also want to add a textview and listview object, and some buttons in it...how would i go about doing that?

View 1 Replies View Related

Android : Way To Set SlidingDrawer On Top Of Other Elements In Layout?

Jul 8, 2010

Is there any way to set my sliding drawer on top of other elements in my layout? I have an ImageView which is intended for an album art and I would like to have a sliding drawer overlay at the bottom of that ImageView.

View 1 Replies View Related

Android : How To Attach Slidingdrawer To Activity?

Jan 10, 2010

Can anyone explain how to attach a sliding drawer to an activity. I get the xml creation part but what do you need to call to actually attach your xml creation to the activity, or even better to a layout within the activity.

View 8 Replies View Related

Android : Can Content Of SlidingDrawer Be A ViewGroup?

May 5, 2009

I try to make the Content view of SlidingDrawer is a ViewGroup, for example , in the Launcher example it can have two GridView in the same SlidingDrawer my sample is to make android:content = "@id/layout" ,which is a LinearLayout but i found only the first child in the layout will be shown so i would like to ask is there any constrain to make SlidingDrawer can not have multiple views in its content?

View 3 Replies View Related

Android :: Contract For Constructing SlidingDrawer Widget?

Mar 11, 2010

I tried to construct SlidingDrawer widget programmatically, but had no luck. The JavaDoc says the constructor needs "AttributeSet attrs" parameter, which is "a specified set of attributes defined in XML".
I provided my own implementation of AttributeSet interface, with all the attributes mentioned in JavaDoc, but got a weird ClassCastException - it seems that it assumes the attrs parameter is of type TypedArray, which seems to be impossible to use as base class (constructor hidden). Is there a way to construct SlidingDrawer programmatically and what is the correct contract to use it ? It is no way clear from the documentation.

View 1 Replies View Related

Android :: Disable A View Behind My SlidingDrawer In Droid?

Apr 7, 2010

I have a SlidingDrawer that pops up from the bottom of the screen and fills the screen about 80%. Even though the SlidingDrawer view is in focus, it is still possible to click on items, buttons and other elements in the view that is behind the SlidingDrawer. When SlidingDrawer is active/pulled up/in focus, I want to disable the entire view behind it so it will not be able to recieve clicks and touches. Is there a good way to disable an entire view? I have tried setEnable(false) and setClickable(false) but neither of them work.

View 2 Replies View Related

Android :: RuntimeException On Widget That Has A Bitmap

Aug 23, 2010

my app has widgets that have an ImageView and a TextView. On the onUpdate() method of the WidgetProvider, I put a Bitmap inside the ImageView this way:

CODE:..................

setColor() method is this:

CODE:..........

The problem is that sometimes the widget throws a RuntimeException because somebody has recycled the Bitmap, and I don't know what to do.

View 2 Replies View Related

Android :: Can't Make SlidingDrawer Closed By Default State / Way To Do

Aug 25, 2010

I'm currently having trouble with a SlidingDrawer. I want it to be closed when the application starts so it doesn't get in the way. However, it is determined that it will be open, despite putting slide.close() in the onCreate() of my activity. It seems to be closed if i use slide.animateClose() instead, but this slows my application down loads.

How do I make it closed by default? code...

View 1 Replies View Related

Android :: Can SlidingDrawer Stop Sliding And Just Stay There With Motionevents

May 12, 2009

What I want to carry out is that the handle of the SlidingDrawer will be dragged by my finger, and when My finger leaves the screen, the handle of the SlidingDrawer will be just stop there and don't slide to top or bottom.

View 6 Replies View Related

Android :: Make Droid SlidingDrawer Slide Out From Left?

Jul 16, 2009

I'm using a slidingDrawer in my application that has its handler placed at the bottom when in portrait mode. When the user switches to landscape mode (widescreen) I would like to have the handler located on the left. When I change the orientation from vertical to horizontal, the handler is placed on the right.

I have defined my layout XML like this:

<SlidingDrawer
android:id="@+id/l_drawer"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:handle="@+id/l_handle"
android:content="@+id/l_content"
android:orientation="horizontal"
android:layout_gravity="left>

Anyone have an idea for how to make it slide from left to right ?

View 3 Replies View Related

Android :: Change Icon On SlidingDrawer Handle When Clicked?

Jul 22, 2009

I'm trying to change the icon on the handle when i try to open the slidingdrawer.
When I extract the handle from the view and sets the onclicklistener or ontouchlistener it seems to never get trigget.code...

I was hoping this code should log "onClick" message, but it doesn't. Any ideas?

View 1 Replies View Related

Android :: ScoreNinja Causes Java.lang RuntimeException

Nov 15, 2010

I'm trying to add ScoreNinja, the global high score system, to my Android game, and it works fine when I load it on my phone, but when I release it into the wild, I got crash reports saying: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()

Here is part of the call stack:

android.os.Handler.<init>(Handler.java:121)
android.app.Dialog.<init>(Dialog.java:99)
android.app.AlertDialog.<init>(AlertDialog.java:65)
android.app.AlertDialog.<init>(AlertDialog.java:61)....

I thought the main thread had prepare() called automatically, and if not, why would it work fine for me but not anyone else?

View 6 Replies View Related

Android :: Inflating Xml Layout Generates RuntimeException

Oct 2, 2010

I'm new to Android and i'm trying to inflate a layout in xml but i get a RuntimeException. I have cut out almost everything except for my activity class and the class extending SurfaceView.

what i'm doing wrong?

CODE:........................

View 4 Replies View Related

Android :: Customized Search - RuntimeException Can't Set Breakpoints

Jul 25, 2010

I am trying to implement my own Search using searchable, and as soon as press return after entering a query into my custom search field, I get a RuntimeException:

CODE:...............

Here is what the logCat reported:

CODE:............

(More):

CODE:..............

I have been trying to figure it out for hours. Here is my AndroidXML:

CODE:.................

View 1 Replies View Related

Android :: RuntimeException OnCreateDialog Did Not Create A Dialog For Id

Nov 19, 2010

I've an application that you can show and close several Dialogs with:

showDialog(...)
removeDialog(...)

I play a little bit with the application and when there is no any Dialog on the screen, I press the menu button and I go to the main android screen.

After a while, I enter again into my application and sometimes, I get this RuntimeException:

CODE:...........

View 2 Replies View Related

Android :: RuntimeException: Canvas: Trying To Use A Recycled Bitmap ..

Aug 22, 2009

I am getting the following logs when i am changing the wallpaper for Homescreen. Even i am recycling the bitmap is done when the wallpaper changes in OnWallpaperChanged(). Still i m getting the bellow error.

CODE:.........................

View 3 Replies View Related

Android :: RuntimeException Without Any Linenumber In Code - Error

Dec 24, 2009

What could be the reason, if I get such a strange error?

CODE:.................

I do not get a special line in my code. How can I find anything out, where the error in my code is?

And the LogCat says all the time:

CODE:............................

View 5 Replies View Related

Android :: FindViewById In A Subclassed SurfaceView Throwing RuntimeException

Oct 9, 2010

This code works fine if I move the findViewById call in to the Activity. Any hints as to why it doesn't work from inside the LearningView class? I've tried moving the TextView inside the com.example.LearningView tag but no joy. I'd prefer to get the TextView from within the SurfaceView subclass as I feel it's more logical to treat the TV as a "child" of the SV.

This is a contrived example I wrote to figure out the problem in a larger application, but the gist of it is the same, and the stack trace is basically the same.

For what it is worth, the findViewById call is returning null, which obviously threw NullPointerExceptions in some attempts to fix this.

As you can probably gather from my attempts I'm flying blind on this one.

Learning.java:

CODE:..........

main.xml:

CODE:..............

Stack trace:

CODE:......................

View 1 Replies View Related

Android :: IsUserAMonkey Throws Exception

Oct 17, 2010

CODE:......................

I get the following exception when trying to use the isUserAMonkey API on a keydown. mAM = (android.app.ActivityManager)getSystemService(Context.ACTIVITY_SERVICE); if (mAM.isUserAMonkey()) {return true;} Any reason why this may be happening?

View 9 Replies View Related

Android :: Why Keep Throws Rescources.NotFoundException

Nov 18, 2009

In the following code, these lines:

CODE:.........

The app keep throws the Rescources.NotFoundException. I checked the xml file, all the ids are defined and they are all in the R.java. So I really don't know why the app throw this exception.

CODE:.......................

View 2 Replies View Related

Android :: Java.lang.RuntimeException - Supply Layout_height Attribute

Feb 15, 2009

I get the following error in logcat: java.lang.RuntimeException: Binary XML file line #26: You must supply a layout_height attribute. Can you please tell me which xml file that I am missing? And it said 'binary xml', does it mean it is actually line 26 in my file? or it is line 26 in the file after it compiles to be a binary xml file?..........

View 4 Replies View Related

Android :: ProgressDialog In AsyncTask Throws An Exception

Jun 25, 2010

I'm trying to make a simple ProgressDialog appear while my AsyncTask is fetching data. In my onPreExecute() method I have this: pd = ProgressDialog.show(c, "Loading...", "Please wait");

c is the context passed into the constructor of my AsyncTask from this.getApplicationContext(). Unfortunately, I keep getting an exception with this message: Unable to add window -- Token null is not for an application

What am I doing wrong?

Using this instead of this.getApplicationContext() has revealed another problem. When I call ProgressDialog.show(..., a ProgressDialog is displayed, but not until after the AsyncTask has completed. In other words, the data loads and then the dialog is displayed. If I include pd.dismiss() in my onPostExecute() then I never even see the dialog (presumable because it is closed before it ever gets opened).

It turns out that fetch.get() was hogging the UI thread and not letting the ProgressDialog display.

View 2 Replies View Related

Android :: Calling NotifyDataSetChanged() Throws Exception

Oct 7, 2010

I have a ListView that I'm binding to an adapter. The adapter is a protected member of my main class. I have a listener thread that receives data and updates the source list for my adapter. When I call the adapter's notifyDataSetChanged() method, an exception is thrown:

Runtime Exception: PhoneLayoutInflater(LayoutInflater).inflate(int, ViewGroup, boolean) line: 322

I've read that the notifyDataSetChanged() method has to be called on the UI thread, and I'm doing that. In fact, just to be sure, I even update the ListView's data source on the UI thread. All I do in my listener thread is update a protected member that houses the data. Here's an example of what I'm doing (note that I don't have the part of the code that calls the AsyncTask, but it's fired from a listener):

CODE:............

Does anyone have any pointers or ideas as to why I'm getting this exception? Any help is much appreciated.

Here are the layout files, as requested:

main.xml:

CODE:....................

row.xml:

CODE:...............................

View 1 Replies View Related

Android :: Java.lang.RuntimeException: Unable To Start Activity ComponentInfo

Nov 8, 2010

I wrote an android app and so far it works perfect except for on one phone. It is the exact phone that I have with 2.2 on both phones and mine works perfect. The other phone is getting force close all the time but only when opening an activity that queries my image DB and tries to show a gallery. Every activity crashes in the same place, the viewimages. At first I thought it was the intent that was doing it but one of the activitys does not have the intent, it opens the images below the gallery. This works on the emulator, on my moto droid and on a few other different droids. Here is the code for the gallery and my bitmap decoder.

The error is below that.

CODE:..............

Here is the error

CODE:.....................

View 1 Replies View Related







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