I created a simple app and start in Android Studio version 3.6.2. I have N Android 10 real device and when I create a break point in onCreate()
, Android Studio jumps to the break point successfully, but after 5 seconds it will disconnect from debugging mode automatically without any error or log. I searched a lot about it but I can't find out why it will disconnect automatically. Has any one had this problem in real Android and how can I solve it?
This is my code
Button btntest;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
btntest=(Button)findViewById(R.id.btntest);
}