Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9047111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T11:49:21+00:00 2026-06-16T11:49:21+00:00

I have an android app that uses the permission CALL_PHONE . This simple app

  • 0

I have an android app that uses the permission “CALL_PHONE“. 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.

At the moment, I am using the setEnabled() and setClickable() method in my MainActivity.java 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 “call” button should be disabled and unclickable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T11:49:23+00:00Added an answer on June 16, 2026 at 11:49 am

    Refer to this

    That will help you in identifying that your application is running on tablet. Now as for disabling your button, I would suggest something like this:

    onCreate()
    {
         setContentView(R.layout.main);
         boolean isTablet = checkDevice();
         callBtn = (Button) findViewById(R.id.call);
         if (isTablet)
         {
            callBtn.setEnabled(false);
            callBtn.setText("Not allowed to make a call");
         }
    
         callBtn.setOnClickListener( new onClickListener(){
               //Make a call
         });
    
    }
    
    public boolean isTablet()
    {
    
        //Code for identifying. Return true if application is running on tablet
        //return false otherwise
    
    }
    

    So you won’t have to wait for user’s click on Call button to disable it in tablet.
    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom view in my Android App that uses a ScaleGestureDetector.SimpleOnScaleGestureListener to
I have a client and a server app on Android (that uses ZeroC -
I have a 2.3.3 android app that I am developing that I would like
I have an Android library project and the main application that uses this library
I have a simple app that so far just turns bluetooth on/off, when i
I have some permissions in my app such as <uses-permission android:name=android.permission.CONTROL_LOCATION_UPDATES /> <uses-permission android:name=android.permission.ACCESS_FINE_LOCATION
I am building an Android app that uses wifi. I have properly declared these
I have Android client app that communicates with server using Socket . On my
I have an android app that I am trying to launch and it gives
I have an Android app that has an Application class and I have another

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.