import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.TextView;
public class MainActivity extends Activity {
public native String stringJNI();
static {
System . loadLibrary ("Androidqw");
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView myTextField = (TextView)findViewById(R.id.myTextField);
myTextField.setText(stringJNI()); //get exception
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}
我在myTextField.setText(stringJNI())
. 我不明白为什么我会得到这个。我的最低 SDK 版本是 10,我的目标是 11。