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

  • SEARCH
  • Home
  • 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 6145741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:50:24+00:00 2026-05-23T18:50:24+00:00

How can we call Intent.ACTION_DIAL from a tab layout? My code is: Resources res

  • 0

How can we call Intent.ACTION_DIAL from a tab layout?

My code is:

 Resources res = getResources(); // Resource object to get Drawables
        TabHost tabHost = getTabHost(); // The activity TabHost
        TabHost.TabSpec spec; // Resusable TabSpec for each tab
        Intent intent; // Reusable Intent for each tab


    // Create an Intent to launch an Activity for the tab (to be reused)
        intent = new Intent(Intent.ACTION_DIAL);
    
        // Initialize a TabSpec for each tab and add it to the TabHost
        spec = tabHost
            .newTabSpec("contacts")
            .setIndicator("Contacts",
                res.getDrawable(R.drawable.tab_contacts))
            .setContent(intent);
            
        tabHost.addTab(spec);

But the app showing an exception

07-14 14:08:21.024: ERROR/AndroidRuntime(543): java.lang.SecurityException: Requesting code from com.android.contacts (with uid 10000) to be run in process org.sipdroid.sipua (with uid 10032)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.app.ActivityThread.getPackageInfo(ActivityThread.java:2330)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2558)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:2503)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:127)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:339)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:651)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.widget.TabHost.setCurrentTab(TabHost.java:323)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.widget.TabHost$2.onTabSelectionChanged(TabHost.java:129)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.widget.TabWidget$TabClickListener.onClick(TabWidget.java:453)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.view.View.performClick(View.java:2408)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.view.View$PerformClick.run(View.java:8816)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.os.Handler.handleCallback(Handler.java:587)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.os.Handler.dispatchMessage(Handler.java:92)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.os.Looper.loop(Looper.java:123)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at android.app.ActivityThread.main(ActivityThread.java:4627)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at java.lang.reflect.Method.invokeNative(Native Method)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at java.lang.reflect.Method.invoke(Method.java:521)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-14 14:08:21.024: ERROR/AndroidRuntime(543):     at dalvik.system.NativeStart.main(Native Method)
07-14 14:08:21.063: WARN/ActivityManager(58):   Force finishing activity org.sipdroid.sipua/.ui.SIPTabWidget
07-14 14:08:21.683: WARN/ActivityManager(58): Activity pause timeout for HistoryRecord{43f7d678 org.sipdroid.sipua/.ui.SIPTabWidget}
07-14 14:08:27.443: DEBUG/dalvikvm(255): GC_EXPLICIT freed 93 objects / 4104 bytes in 135ms
07-14 14:08:32.106: WARN/ActivityManager(58): Activity destroy timeout for HistoryRecord{43f7d678 org.sipdroid.sipua/.ui.SIPTabWidget}
  • 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-05-23T18:50:26+00:00Added an answer on May 23, 2026 at 6:50 pm

    I got it. The intent works fine when I called startActivity() directly from setOnTabChangedListener.

    Here is my code:

    spec = tabHost.newTabSpec("dial")
        .setIndicator("Dialler", res.getDrawable(R.drawable.tab_dial))
        .setContent(intent);
        tabHost.addTab(spec);
    

    and on Tab change I give:

    tabHost.setOnTabChangedListener(new OnTabChangeListener() {
    
            @Override
            public void onTabChanged(String tabId) {
            System.out.println(" Tab ID:  "+tabId);
            
            if(tabId.equals("dial")){
                intent =  new Intent(Intent.ACTION_DIAL);
                startActivity(intent);
                tabHost.setCurrentTab(0);
                        }   }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I noticed that you can call Queue.Synchronize to get a thread-safe queue object, but
From this code I can call bmwCars.CopyToDataTable() as I expected. var bmwCars = from
(Yes I know I can call Java code from Scala; but that is pointless;
Using a delegate I can call any function asynchronously. From the documentation I understand
I want make simple call app. I use this code. Intent intent = new
brought here is the code for making a phone call from my Activity public
I can call the webservie directly to the browser with the following URL and
I know I can call the GetVersionEx Win32 API function to retrieve the Windows
I understand that I can call ToString().IndexOf(...), but I don't want to create an
I know I can call it whatever, but just like there is a convention

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.