Я начинаю с android ... в qr сканере после нажатия кнопки он сканирует и отображает результат в действии. Я хочу, чтобы этот результат отображался для общего доступа preferences..can кто-нибудь поможет мнеКак получить результат от метода результата активности до общих предпочтений
ниже мой код
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_new_screen);
button1 = (Button) findViewById(R.id.button);
customerSno = (TextView) findViewById(R.id.scanContent);
button1.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent i = new Intent(getApplicationContext(), IHomeActivity.class);
startActivity(i);
}
});
}
private void setCustomerSerialNName(String s) {
String customerSNo = IHomeActivity._sharedPreferences.getString("customerSNo", "null");
SharedPreferences.Editor editor =IHomeActivity._sharedPreferences.edit();
editor.putString("customerSNo",s);
//editor.putString("customerPass", passcode);
if (customerSNo.equals(s)) {
} else {
editor.putBoolean("custSNoAuthStatus", false);
}
editor.commit();
LightManager.LightOp lightOp = new LightManager.LightOp();
lightOp.setToWWWMode();
}
public void scanMarginScanner(View view) {
IntentIntegrator integrator = new IntentIntegrator(this);
integrator.setOrientationLocked(false);
integrator.setCaptureActivity(SmallCaptureActivity.class);
integrator.initiateScan();
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
if (result != null) {
String scanContent = result.getContents();
customerSno.setText(" " + scanContent);
} else {
Toast.makeText(getApplicationContext(),"Cancelled", Toast.LENGTH_LONG).show();
}
}
}
Что такое заказчикSno? –