onactivityresult

Android Image Crop Uri Exception

你。 提交于 2019-12-22 10:44:27
问题 first up, I am using Xamarin, but the problem is the same on a native Java project. I was updating the SDK to 5.1 and encountered a strange error on code that worked fine before. imageStream = "file://" + imageStream; Mvx.Trace("path: " + imageStream); img = imageStream; try { Intent cropIntent = new Intent("com.android.camera.action.CROP"); // indicate image type and Uri var fileUri = Android.Net.Uri.Parse(imageStream); cropIntent.SetDataAndType(fileUri, "image/*"); // set crop properties

Why is onActivityResult triggered before activity even starts?

半世苍凉 提交于 2019-12-22 08:59:27
问题 I have an app that needs to scan a barcode to get a code before it can continue. I use this code to start the scanning activity: finish = (Button) findViewById(R.id.finishButton); finish.setOnClickListener(new OnClickListener() { public void onClick(View viewParam) { /*Prompt the user to scan the barcode */ new AlertDialog.Builder(Visit.this) .setMessage("Please Scan the clients barcode to complete the visit") .setPositiveButton("Scan Barcode", new DialogInterface.OnClickListener() {

onActivityResult() not called

£可爱£侵袭症+ 提交于 2019-12-21 06:47:13
问题 onActivityResult() is not getting called. Below is my code: @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // Check which request we're responding to Log.e("CALLED", "OnActivity Result"); if (requestCode == TEAM_SELECTED_REQUEST_CODE) { // Make sure the request was successful if (resultCode == RESULT_OK) { try { mySelectedTeam = getIntent().getStringExtra("teamName"); txtSelectTeamCreateMatch.setText(mySelectedTeam); } catch (Exception e) { e

Error: onActivityResult overrides nothing

岁酱吖の 提交于 2019-12-20 18:07:33
问题 I am programming a speech recognition app in Kotlin for Android. class MainActivity : AppCompatActivity() { public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val intent:Intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) startActivityForResult(intent, REQUEST_CODE) } override fun onActivityResult(requestCode

Error: onActivityResult overrides nothing

↘锁芯ラ 提交于 2019-12-20 18:07:31
问题 I am programming a speech recognition app in Kotlin for Android. class MainActivity : AppCompatActivity() { public override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) val intent:Intent = Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH) intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL, RecognizerIntent.LANGUAGE_MODEL_FREE_FORM) startActivityForResult(intent, REQUEST_CODE) } override fun onActivityResult(requestCode

Android Can you get an activity result from a chained startActivityForResult

孤街醉人 提交于 2019-12-20 15:12:07
问题 I have the following activity screens Activity A - contains a button that links to Activity B Activity B - contains a confirmation of order and then a Next button that opens up a Activity C (to capture signature) Activity C - a dialog box that pops up for the user to enter their signature and a complete button. Activity A - contains intent start to start Activity B and implements onActivityForResult Intent intent = new Intent( this, ConfirmLines.class ); startActivityForResult( intent, GET

ACTION_IMAGE_CAPTURE onActivityResult has empty intent with empty data

丶灬走出姿态 提交于 2019-12-20 08:04:34
问题 After reading this documentation https://developer.android.com/training/camera/photobasics I want to take a photo and to store the uri of the photo into a given variable. The problem is that I'm storing the variable name and the uri into the intent with takePictureIntent.putExtra(Constants.INTENT_EXTRA_VARNAME, variable) and takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, photoURI) , but in onActivityResult the intent data is empty, and neither the variable and the uri stored are empty. I

Android Fragment lifecycle issue (NullPointerException on onActivityResult)

吃可爱长大的小学妹 提交于 2019-12-20 03:24:08
问题 I get an issue which for I cannot find any explanation. I have a FragmentActivity that displays fragments using a TabManager, as follows : public class WorkOrderFormTabFragmentActivity extends FragmentActivity { TabHost mTabHost; TabManager mTabManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.work_order_form_tab_new); mTabHost = (TabHost)findViewById(android.R.id

onActivityResult executing twice

不羁岁月 提交于 2019-12-19 08:30:23
问题 From HomeActivity Im trying to get a result from CreateProfileActivity . Here what i do to start the activity Intent createProfile = new Intent(this, CreatePreacherActivity.class); startActivityForResult(createProfile, 1); Here the implementation of onActivityResult method in HomeActivity : @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 1) { Log.d("DEV","HomeActivity is reciving data"); if (resultCode == RESULT_OK) { // this code

onActivityResult executing twice

雨燕双飞 提交于 2019-12-19 08:30:01
问题 From HomeActivity Im trying to get a result from CreateProfileActivity . Here what i do to start the activity Intent createProfile = new Intent(this, CreatePreacherActivity.class); startActivityForResult(createProfile, 1); Here the implementation of onActivityResult method in HomeActivity : @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == 1) { Log.d("DEV","HomeActivity is reciving data"); if (resultCode == RESULT_OK) { // this code