Monday, April 7, 2014

EditText error problem, please advise


When I joined EditText in xml, open this page will report the following error:
10-04 23:50:12.583: W / System.err (18324): java.lang.IllegalArgumentException: Receiver not registered: android.widget.Editor $ 2 @ 422e5be0
10-04 23:50:12.583: W / System.err (18324): at android.app.LoadedApk.forgetReceiverDispatcher (LoadedApk.java: 675)
10-04 23:50:12.583: W / System.err (18324): at android.app.ContextImpl.unregisterReceiver (ContextImpl.java: 1630)
10-04 23:50:12.583: W / System.err (18324): at android.content.ContextWrapper.unregisterReceiver (ContextWrapper.java: 452)
10-04 23:50:12.583: W / System.err (18324): at android.widget.Editor.onDetachedFromWindow (Editor.java: 471)
10-04 23:50:12.583: W / System.err (18324): at android.widget.TextView.onDetachedFromWindow (TextView.java: 5060)
10-04 23:50:12.583: W / System.err (18324): at android.view.View.dispatchDetachedFromWindow (View.java: 12441)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewRootImpl.dispatchDetachedFromWindow (ViewRootImpl.java: 2956)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewRootImpl.doDie (ViewRootImpl.java: 4585)
10-04 23:50:12.583: W / System.err (18324): at android.view.ViewRootImpl.die (ViewRootImpl.java: 4568)
10-04 23:50:12.583: W / System.err (18324): at android.view.WindowManagerGlobal.removeViewLocked (WindowManagerGlobal.java: 355)
10-04 23:50:12.583: W / System.err (18324): at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java: 305)
10-04 23:50:12.583: W / System.err (18324): at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java: 84)
10-04 23:50:12.583: W / System.err (18324): at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java: 3599)
10-04 23:50:12.583: W / System.err (18324): at android.app.ActivityThread.access $ 1300 (ActivityThread.java: 152)
10-04 23:50:12.583: W / System.err (18324): at android.app.ActivityThread $ H.handleMessage (ActivityThread.java: 1335)
10-04 23:50:12.583: W / System.err (18324): at android.os.Handler.dispatchMessage (Handler.java: 99)
10-04 23:50:12.583: W / System.err (18324): at android.os.Looper.loop (Looper.java: 137)
10-04 23:50:12.593: W / System.err (18324): at android.app.ActivityThread.main (ActivityThread.java: 5328)
10-04 23:50:12.593: W / System.err (18324): at java.lang.reflect.Method.invokeNative (Native Method)
10-04 23:50:12.593: W / System.err (18324): at java.lang.reflect.Method.invoke (Method.java: 511)
10-04 23:50:12.593: W / System.err (18324): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 1102)
10-04 23:50:12.593: W / System.err (18324): at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 869)
10-04 23:50:12.593: W / System.err (18324): at dalvik.system.NativeStart.main (Native Method)
10-04 23:50:12.593: W / System.err (18324): java.lang.IllegalArgumentException: Receiver not registered: android.widget.Editor $ 2 @ 422f48c8
10-04 23:50:12.593: W / System.err (18324): at android.app.LoadedApk.forgetReceiverDispatcher (LoadedApk.java: 675)
10-04 23:50:12.593: W / System.err (18324): at android.app.ContextImpl.unregisterReceiver (ContextImpl.java: 1630)
10-04 23:50:12.593: W / System.err (18324): at android.content.ContextWrapper.unregisterReceiver (ContextWrapper.java: 452)
10-04 23:50:12.593: W / System.err (18324): at android.widget.Editor.onDetachedFromWindow (Editor.java: 471)
10-04 23:50:12.593: W / System.err (18324): at android.widget.TextView.onDetachedFromWindow (TextView.java: 5060)
10-04 23:50:12.593: W / System.err (18324): at android.view.View.dispatchDetachedFromWindow (View.java: 12441)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewRootImpl.dispatchDetachedFromWindow (ViewRootImpl.java: 2956)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewRootImpl.doDie (ViewRootImpl.java: 4585)
10-04 23:50:12.593: W / System.err (18324): at android.view.ViewRootImpl.die (ViewRootImpl.java: 4568)
10-04 23:50:12.593: W / System.err (18324): at android.view.WindowManagerGlobal.removeViewLocked (WindowManagerGlobal.java: 355)
10-04 23:50:12.593: W / System.err (18324): at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java: 305)
10-04 23:50:12.593: W / System.err (18324): at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java: 84)
10-04 23:50:12.593: W / System.err (18324): at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java: 3599)
10-04 23:50:12.603: W / System.err (18324): at android.app.ActivityThread.access $ 1300 (ActivityThread.java: 152)
10-04 23:50:12.603: W / System.err (18324): at android.app.ActivityThread $ H.handleMessage (ActivityThread.java: 1335)
10-04 23:50:12.603: W / System.err (18324): at android.os.Handler.dispatchMessage (Handler.java: 99)
10-04 23:50:12.603: W / System.err (18324): at android.os.Looper.loop (Looper.java: 137)
10-04 23:50:12.603: W / System.err (18324): at android.app.ActivityThread.main (ActivityThread.java: 5328)
10-04 23:50:12.603: W / System.err (18324): at java.lang.reflect.Method.invokeNative (Native Method)
10-04 23:50:12.603: W / System.err (18324): at java.lang.reflect.Method.invoke (Method.java: 511)
10-04 23:50:12.603: W / System.err (18324): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 1102)
10-04 23:50:12.603: W / System.err (18324): at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 869)
10-04 23:50:12.603: W / System.err (18324): at dalvik.system.NativeStart.main (Native Method)
10-04 23:50:12.603: W / System.err (18324): java.lang.IllegalArgumentException: Receiver not registered: android.widget.Editor $ 2 @ 422f87e0
10-04 23:50:12.603: W / System.err (18324): at android.app.LoadedApk.forgetReceiverDispatcher (LoadedApk.java: 675)
10-04 23:50:12.603: W / System.err (18324): at android.app.ContextImpl.unregisterReceiver (ContextImpl.java: 1630)
10-04 23:50:12.603: W / System.err (18324): at android.content.ContextWrapper.unregisterReceiver (ContextWrapper.java: 452)
10-04 23:50:12.603: W / System.err (18324): at android.widget.Editor.onDetachedFromWindow (Editor.java: 471)
10-04 23:50:12.603: W / System.err (18324): at android.widget.TextView.onDetachedFromWindow (TextView.java: 5060)
10-04 23:50:12.603: W / System.err (18324): at android.view.View.dispatchDetachedFromWindow (View.java: 12441)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewGroup.dispatchDetachedFromWindow (ViewGroup.java: 2626)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewRootImpl.dispatchDetachedFromWindow (ViewRootImpl.java: 2956)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewRootImpl.doDie (ViewRootImpl.java: 4585)
10-04 23:50:12.603: W / System.err (18324): at android.view.ViewRootImpl.die (ViewRootImpl.java: 4568)
10-04 23:50:12.603: W / System.err (18324): at android.view.WindowManagerGlobal.removeViewLocked (WindowManagerGlobal.java: 355)
10-04 23:50:12.603: W / System.err (18324): at android.view.WindowManagerGlobal.removeView (WindowManagerGlobal.java: 305)
10-04 23:50:12.603: W / System.err (18324): at android.view.WindowManagerImpl.removeViewImmediate (WindowManagerImpl.java: 84)
10-04 23:50:12.603: W / System.err (18324): at android.app.ActivityThread.handleDestroyActivity (ActivityThread.java: 3599)
10-04 23:50:12.603: W / System.err (18324): at android.app.ActivityThread.access $ 1300 (ActivityThread.java: 152)
10-04 23:50:12.603: W / System.err (18324): at android.app.ActivityThread $ H.handleMessage (ActivityThread.java: 1335)
10-04 23:50:12.603: W / System.err (18324): at android.os.Handler.dispatchMessage (Handler.java: 99)
10-04 23:50:12.613: W / System.err (18324): at android.os.Looper.loop (Looper.java: 137)
10-04 23:50:12.613: W / System.err (18324): at android.app.ActivityThread.main (ActivityThread.java: 5328)
10-04 23:50:12.613: W / System.err (18324): at java.lang.reflect.Method.invokeNative (Native Method)
10-04 23:50:12.613: W / System.err (18324): at java.lang.reflect.Method.invoke (Method.java: 511)
10-04 23:50:12.613: W / System.err (18324): at com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java: 1102)
10-04 23:50:12.613: W / System.err (18324): at com.android.internal.os.ZygoteInit.main (ZygoteInit.java: 869)
10-04 23:50:12.613: W / System.err (18324): at dalvik.system.NativeStart.main (Native Method)

xml increase of EditText added as follows:
android: id = "@ + id / shnametxt"
android: layout_width = "305dp"
android: layout_height = "46dp"
android: layout_alignParentBottom = "true"
android: layout_alignParentLeft = "true"
android: layout_marginLeft = "26dp"
android: layout_marginBottom = "117dp"
android: background = "@ drawable / edittextbg"
android: inputType = "text"
>
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
This xml file as follows:

android: layout_width = "match_parent"
android: layout_height = "match_parent">

android: layout_width = "match_parent"
android: layout_height = "match_parent"
android: layout_centerInParent = "true"
android: adjustViewBounds = "false"
android: background = "@ drawable/first4"
android: focusable = "true"
android: scaleType = "centerCrop" />

android: id = "@ + id/iv6"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentBottom = "true"
android: layout_alignParentLeft = "true"
android: layout_marginLeft = "10dp"
android: layout_marginBottom = "30dp"
android: background = "@ drawable/first21"
/>

android: id = "@ + id/iv7"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentBottom = "true"
android: layout_alignParentRight = "true"
android: layout_marginRight = "10dp"
android: layout_marginBottom = "30dp"
android: background = "@ drawable/first22"
/>
android: id = "@ + id/iv8"
android: layout_width = "wrap_content"
android: layout_height = "wrap_content"
android: layout_alignParentTop = "true"
android: layout_alignParentRight = "true"
android: layout_marginRight = "13dp"
android: layout_marginTop = "220dp"
android: background = "@ drawable / photobg"
/>

android: id = "@ + id/username1"
android: layout_width = "176dp"
android: layout_height = "46dp"
android: layout_alignParentLeft = "true"
android: layout_alignParentTop = "true"
android: layout_marginLeft = "26dp"
android: layout_marginTop = "240dp"
android: background = "@ drawable / edittextbg"
android: inputType = "text"
>



android: id = "@ + id/username2"
android: layout_width = "176dp"
android: layout_height = "46dp"
android: layout_alignParentTop = "true"
android: layout_alignParentLeft = "true"
android: layout_marginLeft = "26dp"
android: layout_marginTop = "299dp"
android: background = "@ drawable / edittextbg"
android: inputType = "text"
>


android: id = "@ + id / shnametxt"
android: layout_width = "305dp"
android: layout_height = "46dp"
android: layout_alignParentBottom = "true"
android: layout_alignParentLeft = "true"
android: layout_marginLeft = "26dp"
android: layout_marginBottom = "117dp"
android: background = "@ drawable / edittextbg"
android: inputType = "text"
>




When I delete edittext, there would be an error.
Reply:
Manifest Tieshanglai code and look.
Reply:
Code is as follows:
package com.test.test;

import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.text.SimpleDateFormat;
import java.util.Date;

import android.app.Activity;
import android.bluetooth.BluetoothDevice;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.Bitmap;
import android.graphics.Bitmap.CompressFormat;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.graphics.drawable.Drawable;
import android.hardware.Camera;
import android.hardware.Camera.PictureCallback;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.Message;
import android.provider.MediaStore;
import android.view.View;
import android.view.View.OnClickListener;

import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class FirstD extends Activity
{
private ImageView prePage, nextPage, photoR;
/ / Private EditText youName, youName1, shName;
private File mPhotoFile;
private String mPhotoPath;
public final static int CAMERA_RESULT = 8888;
public final static String TAG = "xx";

@ Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.first_d);
prePage = (ImageView) findViewById (R.id.iv6);
nextPage = (ImageView) findViewById (R.id.iv7);
photoR = (ImageView) findViewById (R.id.iv8);
/ / YouName = (EditText) findViewById (R.id.username1);
/ / YouName1 = (EditText) findViewById (R.id.username2);
/ / ShName = (EditText) findViewById (R.id.shnametxt);
prePage.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
goPrePage ();
}
});
nextPage.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
goNextPage ();
}
});
photoR.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
try {
Intent intent = new Intent ("android.media.action.IMAGE_CAPTURE");
mPhotoPath = "mnt / sdcard / DCIM / Camera /" + getPhotoFileName ();
mPhotoFile = new File (mPhotoPath);
if (! mPhotoFile.exists ()) {
mPhotoFile.createNewFile ();
}
intent.putExtra (MediaStore.EXTRA_OUTPUT, Uri.fromFile (mPhotoFile));
startActivityForResult (intent, CAMERA_RESULT);
} Catch (Exception e) {
}

}
});
}
private String getPhotoFileName () {
Date date = new Date (System.currentTimeMillis ());
SimpleDateFormat dateFormat = new SimpleDateFormat ("'IMG'_yyyy");
return dateFormat.format (date) + "jpg.";
}

private void goNextPage ()
{
Intent intent = new Intent (this, FirstE.class);
startActivity (intent);
finish ();
}
private void goPrePage ()
{
Intent intent = new Intent (this, FirstC.class);
startActivity (intent);
finish ();
}


public static Bitmap PicZoom (Bitmap bmp, int width, int height) {
int bmpWidth = bmp.getWidth ();
int bmpHeght = bmp.getHeight ();
Matrix matrix = new Matrix ();

matrix.postScale ((float) width / (float) bmpWidth, (float) height / (float) bmpHeght);


return Bitmap.createBitmap (bmp, 0, 0, bmpWidth, bmpHeght, matrix, true);
}



@ Override
protected void onActivityResult (int requestCode, int resultCode, Intent data) {
super.onActivityResult (requestCode, resultCode, data);
if (requestCode == CAMERA_RESULT) {
/ / Bitmap bitmap = BitmapFactory.decodeFile (mPhotoPath, null);
/ / Matrix matrix = new Matrix ();
/ / Float scaleWidth = (float) 0.2;
/ / Float scaleHeight = (float) 0.2;
/ / Matrix.postScale (scaleWidth, scaleHeight);
/ / PhotoR.setImageMatrix (matrix);
/ / PhotoR.setScaleType (ScaleType.MATRIX);

/ / Configuration.ORIENTATION_LANDSCAPE
Bitmap camorabitmap = BitmapFactory.decodeFile (mPhotoPath, null);
/ / Bitmap bitmap = BitmapFactory.decodeStream (getResources () openRawResource (R.drawable.photos).);
/ / Int scale = reckonThumbnail (camorabitmap.getWidth (), camorabitmap.getHeight (), 170,180);
Bitmap bitmap = PicZoom (camorabitmap, 126,130);
camorabitmap.recycle ();
photoR.setVisibility (View.VISIBLE);
photoR.setImageBitmap (bitmap);


}
}


}
When I press on to eleven when an error occurs above
Reply:
Manifest follows:

package = "com.test.test"
android: versionCode = "1"
android: versionName = "1.0">

android: minSdkVersion = "17"
android: targetSdkVersion = "17" />

android: allowBackup = "true"
android: icon = "@ drawable / ic_launcher"
android: label = "@ string / app_name"
android: theme = "@ android: style / Theme.NoTitleBar"
android: screenOrientation = "portrait"
>
android: name = "com.test.test.First"

android: label = "@ string / app_name"
>








android: name = ". HRPService"
android: enabled = "true" />














Reply:
Code is incomplete, I tried it, no way to reproduce the problem.
Otherwise you put the code package spread network disk, I can help you debug it.

No comments:

Post a Comment