Home > other >  New do Android puzzle game, but in the implementation choice the pictures of the mobile phone photo
New do Android puzzle game, but in the implementation choice the pictures of the mobile phone photo

Time:09-22

As title, please, to explain what is wrong

CodePudding user response:

Post code, DDMS error information posted
It is no good guess

CodePudding user response:

Protected void onActivityResult (int requestCode, int the resultCode, Intent data) {
Super. OnActivityResult (requestCode, the resultCode, data);
If (the resultCode==RESULT_OK) {
If (requestCode==RESULT_IMAGE & amp; & The data!=null) {
//album
Cursor Cursor=this. GetContentResolver () query (data. The getData (), null, null, null, null);
If (cursor!=null) {
Cursor. MoveToFirst ();
String imagePath=cursor. Get String (cursor. GetColumnIndex (" _data while forming "));
Intent Intent=new Intent (MainActivity. This, PuzzleMain. Class);
Intent. PutExtra (MY_PICPATH, imagePath);
Intent. PutExtra (" mType "mType);
Cursor. The close ();
startActivity(intent);
}
{} else if (requestCode==RESULT_CAMERA)
//camera
Intent Intent=new Intent (MainActivity. This, PuzzleMain. Class);
Intent. PutExtra (MY_PICPATH TEMP_IMAGE_PATH);
Intent. PutExtra (" mType "mType);
startActivity(intent);
}
}
}
  • Related