editText field is required before moving on to another Activity

I have validation for editText. If the editText field is empty it should fail validation and stop the user moving on to another Activity, as a value is required. How to do it? I know this is a basic question, but I can’t figure out how to do this. My code: btninsert = (Button)findViewById(R.id.btn_insert); btninsert.setOnClickListener( […]

HonyComb and DefaultHttpClient

In my code I have this Log.d(“WFlog (executeRequest)”, request.toString()) ; httpResponse = client.execute(request); Log.d(“WFlog (execute)”, request.toString()) ; running the app using Android 2.2 is going fine and in logcat I see both log lines. Now running the app using HonyComb for the same piece of code it seems I never get passed the client.execute correctly. […]

is there a way to disable hardware acceleration only for android 4.0.3?

I have recently stumbled upon an issue with android 4.0.3, where Im getting the following Exception as soon as the application starts (on other android versions it works fine): java.lang.NullPointerException at android.view.GLES20RecordingCanvas.drawPatch(GLES20RecordingCanvas.java:97) at android.graphics.NinePatch.draw(NinePatch.java:125) at android.graphics.drawable.NinePatchDrawable.draw(NinePatchDrawable.java:189) at android.widget.ImageView.onDraw(ImageView.java:892) at android.view.View.draw(View.java:10978) at android.view.ViewGroup.drawChild(ViewGroup.java:2887) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) at android.view.ViewGroup.drawChild(ViewGroup.java:2885) at android.view.ViewGroup.dispatchDraw(ViewGroup.java:2489) at android.view.View.getDisplayList(View.java:10415) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:2597) at android.view.View.getDisplayList(View.java:10380) at […]

How to remove the “ .0” in a whole number when using double in java?

Possible Duplicate: How do I format a number in java? I have problems in using Double. When the result is a whole number, it would display with a ” .0″ like 1.0, 2.0. Can anyone help me how to remove that .0 in a whole number?

How to pass data from a fragment to a dialogFragment

I know that this was asked before, but I dont quite understand how to implement it. I have a fragment “myFragment” in which I create an object of a “myDialogueFragment”. I want to pass some value to the myDialogueFragment when I invoke it from the myFragment. I have an integer num, that I want to […]

How to set an image to imageView using filepath in android

I am getting file path of image by using browse button….after that I want to set this image to an image view using the file path

LongClick event also triggers Click event

I use onLongClick and onClick events of a button to get user inputs. Whenever; the user long click and triggers onLongClick event, the onClick event is also triggered. I couldn’t find my problem. The code of two methods are shown in below: @Override public void onClick(View v) { switch(((Button) v).getId()) { case R.id.enter: EntertheNumber(); break; […]

Change Navigation View Item Color Dynamically Android

I’d like to build a navigation drawer where each item has a different selection color (the icon tint and text color) as the google play store has: I’m not sure how they’ve solved this, I think they use different activities with different drawers. I want to use fragments and I want to change the icon […]

phonegap geolocation allways fail on timeout

I’m using sencha-touch 2.0 and phonegap 2.0.0 in my app to retrieve user’s location. When runing on my locahost, everything works just fine. However, when loading the .apk to my android 15 api’s device (using eclipse and the adt plugin), every call to getCurrentLocation or watchPosition never returns… here is my code: geoOn: function(){ var […]

Change Relative layout width and height dynamically

Hi i am using following layout structure inside LinearLayout <TableLayout android:layout_width=”fill_parent” android:layout_height=”wrap_content” > <TableRow android:layout_width=”fill_parent” android:layout_height=”wrap_content” > </TableRow> <TableRow android:layout_width=”fill_parent” android:layout_height=”wrap_content” > <TextView android:id=”@+id/tv1″ android:layout_height=”wrap_content” android:gravity=”left” android:paddingLeft=”10dp” android:textColor=”#000″ /> <TextView android:id=”@+id/tv2″ android:layout_height=”wrap_content” android:layout_weight=”1.0″ android:gravity=”right” android:paddingRight=”10dp” android:textColor=”#000″ /> </TableRow> </TableLayout> <ImageView android:id=”@+id/img1″ android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:layout_gravity=”center” /> <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”320px” android:layout_height=”320px” android:gravity=”center” > </RelativeLayout> and want to […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.