Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot locate source?
    primarykey
    data
    text
    <p>so, i've been working on this same stupid thing for a while now. some folks here have helped me get it to the point it is but now i've got to move farther forward... but first, my code:</p> <pre><code>package com.mhe.test.scan; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.Toast; public class main extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button myScanButton = (Button) findViewById(R.id.myScanButton); totalbox = (EditText) findViewById(R.id.tBox); myScanButton.setOnClickListener(new Button.OnClickListener() { public void onClick(View v) { Intent intent = new Intent("com.google.zxing.client.android.SCAN"); intent.putExtra("SCAN_MODE", "PRODUCT_MODE"); startActivityForResult(intent, 0); } }); } private EditText totalbox; @Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (requestCode == 0) { if (resultCode == RESULT_OK) { final String contents = intent.getStringExtra("SCAN_RESULT"); if ( totalbox != null ); totalbox.setText(contents); Context context = getApplicationContext(); CharSequence text = "Successful Scan"; int duration = Toast.LENGTH_SHORT; Toast toast = Toast.makeText(context, text, duration); toast.show(); Button myTotalButton = (Button) findViewById(R.id.myTotalButton); myTotalButton.setOnClickListener(new Button.OnClickListener() { public void onClick(View view) { Intent pass = new Intent(view.getContext(), Result.class); startActivityForResult(pass, 0); } }); } else if (resultCode == RESULT_CANCELED) { if ( totalbox != null ); totalbox.setText("bummer"); } } } } </code></pre> <p>so anyhow, what i'd like to happen is upon a successful scan, the result is loaded into the EditText totalbox. then the 'myTotalButton' is clicked and will pass the result to the next activity 'Result.class'. right now i'm just trying to get it to switch to the new activity. If the<br> <code>Button myTotalButton = (Button) findViewById(R.id.myTotalButton); myTotalButton.setOnClickListener(new Button.OnClickListener() { public void onClick(View view) { Intent pass = new Intent(view.getContext(), Result.class); startActivityForResult(pass, 0);</code></p> <p>code is there, it FCs. otherwise, the rest of it works fine. any suggestions/assistance would be helpful. I feel like i am missing something stupid that i will smack myself for.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload