Я получаю эту ошибку при попытке передать данные из одного действия в другое с помощью целевых пакетов. В textView ничего не отображается. Любая помощь приветствуется.
Задание 1
(And here content is a multiline edittext)
text = content.getText().toString();
submit.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Bundle extras = new Bundle();
*Adding key value pairs to this bundle
there are quite a lot data types you can store in a bundle*
extras.putString("ITEM",text);
*create and initialize an intent*
Intent intent = new Intent(getApplicationContext(), currentRequests.class);
*attach the bundle to the Intent object*
intent.putExtras(extras);
*finally start the activity*
startActivity(intent);
}
});
следующее занятие
t = (TextView)findViewById(R.id.textView12);
Intent intent = getIntent();
*get the attached bundle from the intent*
Bundle extras = intent.getExtras();
*Extracting the stored data from the bundle*
if(intent != null)
{
final String user = extras.getString("ITEM");
t.setText(user);
}
}