在Windows上构建Cordova应用程序并进行测试。在我的Windows手机上,硬件后退按钮不会触发Cordova的后退按钮事件。
我尝试过多种方法来捕获事件,但到目前为止还没有成功。有人得到了答案吗?
目前我的代码是:
public class display extends AppCompatActivity {
TextView tv_one, tv_two, tv_three, tv_four, tv_five, tv_six, tv_seven, tv_eight, tv_nine, tv_ten, tv_eleven, tv_twelve, tv_thirdeen,
tv_fourteen, tv_fifteen;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_display);
tv_one = (TextView) findViewById(R.id.txt_1);
tv_two = (TextView) findViewById(R.id.txt_2);
tv_three = (TextView) findViewById(R.id.txt_3);
tv_four = (TextView) findViewById(R.id.txt_4);
tv_five = (TextView) findViewById(R.id.txt_5);
tv_six = (TextView) findViewById(R.id.txt_6);
tv_seven = (TextView) findViewById(R.id.txt_7);
tv_eight = (TextView) findViewById(R.id.txt_8);
tv_nine = (TextView) findViewById(R.id.txt_9);
tv_ten = (TextView) findViewById(R.id.txt_10);
tv_eleven = (TextView) findViewById(R.id.txt_11);
tv_twelve = (TextView) findViewById(R.id.txt_12);
tv_thirdeen = (TextView) findViewById(R.id.txt_13);
tv_fourteen = (TextView) findViewById(R.id.txt_14);
tv_fifteen = (TextView) findViewById(R.id.txt_15);
Bundle bundle = getIntent().getExtras();
tv_one.setText("name" + bundle.getString("name"));
tv_two.setText("email" + bundle.getString("email"));
tv_three.setText("license_id " + bundle.getString("license_id"));
tv_four.setText("current_loc " + bundle.getString("current_loc"));
tv_five.setText("status " + bundle.getString("status"));
tv_six.setText("password " + bundle.getString("password"));
tv_seven.setText("passcode " + bundle.getString("passcode"));
tv_eight.setText("mobile " + bundle.getString("mobile"));
tv_nine.setText("idcard " + bundle.getString("idcard"));
tv_ten.setText("address " + bundle.getString("address"));
tv_eleven.setText("emptype " + bundle.getString("emptype"));
tv_twelve.setText("gst_reg " + bundle.getString("gst_reg"));
tv_thirdeen.setText("job_status " + bundle.getString("job_status"));
tv_fourteen.setText("joiningdate " + bundle.getString("joiningdate"));
tv_fifteen.setText("timestamp " + bundle.getString("timestamp "));
}
这些都不是捕获事件:应用程序总是暂停而不是返回上一页。