我这次使用的是Serializable Interface.我想将ArrayList从一个活动传递到另一个活动,但它给了我这个错误"无法编组值",代码是,
//发送活动:
public class LogIn extends Activity implements OnClickListener
{
ProgressDialog pd;
ImageButton logIn,registr;
EditText userName,Password;
public static String usrName,passwrd;
String TAG=LogIn.class.getName();
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.login);
userName=(EditText)findViewById(R.id.logIn_etuserName);
Password=(EditText)findViewById(R.id.logIn_etpaswrd);
logIn=(ImageButton)findViewById(R.id.logIn_B_logIn);
registr=(ImageButton)findViewById(R.id.logIn_B_registration);
logIn.setOnClickListener(this);
registr.setOnClickListener(this);
}
@Override
public void onClick(View v)
{
String respns="";
switch (v.getId())
{
case R.id.logIn_B_logIn:
try
{
usrName=userName.getText().toString();
passwrd=Password.getText().toString();
if(usrName.contentEquals("") && passwrd.contentEquals(""))
{
Toast.makeText(getApplicationContext(), "Enter userName",Toast.LENGTH_LONG).show();
}
// else if(passwrd.contentEquals(""))
// {
// Toast.makeText(getApplicationContext(), "Enter password",Toast.LENGTH_LONG).show();
// }
else
{
pd=ProgressDialog.show(LogIn.this, "LogIn", "Logging");
new …Run Code Online (Sandbox Code Playgroud)