Hi:
I have an application with a MainActivity with a Forward button. When
I click this button, I'm requesting for surperuser permissions by
process.Runtime.getRuntime().exec("su"). I'm attempting to manage the
dialog with the exitValue(). When I click on "deny" in Superuser
dialog it works correctly (I make a finish ()) but if I click on
"Allow" in Superuser dialog it doesn't work correctly (button keep
pressed but an Intent to go to another activity never is executed).
This is the code:
Button btnNext = (Button) findViewById(R.id.btnNext);
btnNext.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
try {
process =
Runtime.getRuntime().exec("su");
} catch (IOException e) {
e.printStackTrace();
}
try {
process.waitFor();
} catch (InterruptedException e) {
e.printStackTrace();
}
int exitVal = process.exitValue();
if (exitVal!=0)
{
finish();
}
else
{
Intent intent = new
Intent(MainActivity.this,Types.class);
startActivity(intent);
}
}//onClick
});//onClickListener
I'm blocked here. Any idea?
Thanks!
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en