Disabling Android Button depending on Permissions
<p>I have an android app that uses the permission "<strong>CALL_PHONE</strong>". This simple app would just contain a button that would use the call intent to call a specific number. I would like to install this app on both tablets and phone but when it is installed on the tablet, I would like the button to be disabled during runtime so errors wouldn't show when the user tries to call using the tablet without a call function. </p>

<p>At the moment, I am using the <code>setEnabled()</code> and <code>setClickable()</code> method in my <code>MainActivity.java</code> and setting it to false when the user clicks on the button the first time. My question is whether the button can be disabled and the text changed during runtime or when the app is first opened (in a tablet) so the user wouldn't have to click the button first for it to show that the "<strong>call</strong>" button should be disabled and unclickable?</p>
