当我从main切换活动时,我的应用程序关闭。当我检查日志时,我看到的唯一错误是:
Emulator: coreaudio: Could not lock voice for audioOutputDeviceIOProc
Emulator: Reason: Invalid argument
我已经更改了hw:audioOutput = no和hw:audioInput = no但是事情仍然无效。我如何使用Intent是一个问题吗?如何让这个应用程序停止崩溃。谢谢
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.Toast;
public class MainActivity extends AppCompatActivity {
ImageButton SuvButton;
ImageButton TwoDoorButton;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
SuvButton = (ImageButton) findViewById(R.id.SuvImageButton);
SuvButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
//Toast.makeText(MainActivity.this,"Suv Button Works",Toast.LENGTH_LONG).show();
startActivity(new Intent(MainActivity.this, ExpandableText.class));
}
});
TwoDoorButton = (ImageButton) findViewById(R.id.TwoDoorImageButton);
TwoDoorButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast.makeText(MainActivity.this,"Two Door Button Works",Toast.LENGTH_LONG).show();
//Intent intentTwo = new Intent(MainActivity.this,ExpandableText.class);
//startActivity(intentTwo);
}
});
}
}
答案 0 :(得分:0)
您是否在AndroidManifest.xml中注册了ExpandableText
个活动?