0

I got the following crash report in the android market place. While testing I haven't found any crash and my app works fine. Once I published my app I got the following crash report which I have shown below.

But I am not able to find where the crash occurs, I checked in some stack overflow question and there in some cases I got that use of setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD); make cause crash in some devices. Is it true because in my app in some activity I have used this line of code in order to change the input type of EditText from password-text / text-password?

Please help me to solve this out.

Stack Trace

java.lang.NullPointerException
at android.widget.TextView.onTouchEvent(TextView.java:7529)
at android.view.View.dispatchTouchEvent(View.java:3933)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:906)
at  com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1877)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1211)
at android.app.Activity.dispatchTouchEvent(Activity.java:2198)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1852)
at android.view.ViewRoot.deliverPointerEvent(ViewRoot.java:2382)
at android.view.ViewRoot.handleMessage(ViewRoot.java:2010)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:150)
at android.app.ActivityThread.main(ActivityThread.java:4385)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
at dalvik.system.NativeStart.main(Native Method)


<EditText
    android:id="@+id/txt_edit_passwrd"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/txt_passwrd_title"
    android:background="@drawable/img_password_textbox"
    android:cursorVisible="true"
    android:layout_marginTop="195dp"
    android:hint="@string/passwrd_hint_text"
    android:inputType="textPassword"
    android:maxLength="10"
    android:padding="10dp"
    android:textColor="#121212" >
</EditText>
0

3 Answers 3

1

NullPointerException in my own experience tends to mean it cannot find a reference object for instance the edit text your setting the input type for cannot be found, check your layout references and how you've declared the EditText itself.

Sign up to request clarification or add additional context in comments.

4 Comments

the problem lies on one of your TextViews, android.widget.TextView.onTouchEvent(TextView.java:7529) Its not being found/referenced correctly, (IN CODE) not in your XML
@How can i locate that crash...i test it but it never crash..so its very difficult to find the exact crash position
The easiest thing i can reccomend, is go to said line in your code (7529) find the textview and sourround it with a 'Try-catch' statement, that way the errors handled and the app wont simply crash
Open the file, CTRL+L type in 7529 press enter, check the code for all textviews at said location.
0

First check , Have you mention Minimum_sdk_version in android-manifest?

if not then following may be the reason of crashing your application--

If you are using that functionality of android o.s that does not support on customer device.Say you are using Finger_Pointer(as MotionEvent.ACTION_POINTER_DOWN) which does not support before android 2.0.

Or you are using onBackPressed() which does not support for android 1.6.I just gave you hint you can check other issue like this if you have

Updated

For HTC device, TextView's property InputType.TYPE_CLASS_NUMBER lead to crash

Here is the same problem discussed you can refer to this also.

3 Comments

yeh i mention android:minSdkVersion="8" , yeh i have used MotionEvent.ACTION_DOWN, MotionEvent.ACTION_UP, in some of my classes. and i have used onBackPressed() also. but my minSdkVersion="8" which is 2.1 i think
That i don't know but my app support only for those devices having android 2.2 and up
@AndroidDev me to get same issue in Google play store. have you resolver that issue? if resolve that issue means help me how can i resolve that issue
0

The Solution is not to use "setInputType" with a TextView. You don't need input type filtering for TextViews anyway since they are for displaying text only. Input type is only needed for EditText (and there it works). I had the same problem with Android versions below 4.2.

The disadvantage is, that applying input type "password" on a textview actually makes sense as it masks the password, which may be intended (it was in my case). But this causes random crashes when touching or scrolling over the textview.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.