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 7767355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:39:22+00:00 2026-06-01T15:39:22+00:00

I am making an app which contains fragments within tabs.In this whenever I try

  • 0

I am making an app which contains fragments within tabs.In this whenever I try to call in-app billing request purchase it gives me the error pasted below.

Here is the design of my fragments call within app.

CalendarUIActivity (FragmentActivity) -> CalendarUIMain (Fragment) -> When the user ask for more then InAppSubsricbe (DialogFragment) -> On click of OK of above dialog another dialog fragment got open with list of In-App Products which InAppProductsList(DialogFragment)

Now when I click on list of product from Dialog Fragment Edit it redirects it method to main CalendarUIMain Fragment at that time it gives me error (as pasted below) with the market purchase screen opened successfully.But on click on OK of purchase screen it disappers as the application is forced close.

04-11 09:10:52.450: E/AndroidRuntime(1966): FATAL EXCEPTION: main
04-11 09:10:52.450: E/AndroidRuntime(1966): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.uks.android.epn.activity/com.uks.android.epn.activity.MainActivity}: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.uks.android.epn.activity/com.uks.android.epn.activity.CalendarUIActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.uks.android.epn.fragments.CalendarUIMain$InAppProductsDialog: make sure class name exists, is public, and has an empty constructor that is public
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1818)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1834)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3200)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.access$600(ActivityThread.java:125)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1031)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.os.Looper.loop(Looper.java:132)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.main(ActivityThread.java:4135)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at java.lang.reflect.Method.invokeNative(Native Method)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at java.lang.reflect.Method.invoke(Method.java:491)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:599)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at dalvik.system.NativeStart.main(Native Method)
04-11 09:10:52.450: E/AndroidRuntime(1966): Caused by: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.uks.android.epn.activity/com.uks.android.epn.activity.CalendarUIActivity}: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.uks.android.epn.fragments.CalendarUIMain$InAppProductsDialog: make sure class name exists, is public, and has an empty constructor that is public
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1818)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.startActivityNow(ActivityThread.java:1659)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.LocalActivityManager.moveToState(LocalActivityManager.java:135)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.LocalActivityManager.startActivity(LocalActivityManager.java:347)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.widget.TabHost$IntentContentStrategy.getContentView(TabHost.java:676)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.widget.TabHost.setCurrentTab(TabHost.java:345)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.widget.TabHost.addTab(TabHost.java:235)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.uks.android.epn.activity.MainActivity.addTab(MainActivity.java:78)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.uks.android.epn.activity.MainActivity.initTabs(MainActivity.java:45)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.uks.android.epn.activity.MainActivity.onCreate(MainActivity.java:35)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.Activity.performCreate(Activity.java:4397)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1782)
04-11 09:10:52.450: E/AndroidRuntime(1966):     ... 12 more
04-11 09:10:52.450: E/AndroidRuntime(1966): Caused by: android.support.v4.app.Fragment$InstantiationException: Unable to instantiate fragment com.uks.android.epn.fragments.CalendarUIMain$InAppProductsDialog: make sure class name exists, is public, and has an empty constructor that is public
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.support.v4.app.Fragment.instantiate(Fragment.java:395)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.support.v4.app.FragmentState.instantiate(Fragment.java:96)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.support.v4.app.FragmentManagerImpl.restoreAllState(FragmentManager.java:1726)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:198)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.uks.android.epn.activity.ActivitysTab.onCreate(ActivitysTab.java:25)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at com.uks.android.epn.activity.CalendarUIActivity.onCreate(CalendarUIActivity.java:23)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.Activity.performCreate(Activity.java:4397)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1048)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1782)
04-11 09:10:52.450: E/AndroidRuntime(1966):     ... 24 more
04-11 09:10:52.450: E/AndroidRuntime(1966): Caused by: java.lang.InstantiationException: com.uks.android.epn.fragments.CalendarUIMain$InAppProductsDialog
04-11 09:10:52.450: E/AndroidRuntime(1966):     at java.lang.Class.newInstanceImpl(Native Method)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at java.lang.Class.newInstance(Class.java:1301)
04-11 09:10:52.450: E/AndroidRuntime(1966):     at android.support.v4.app.Fragment.instantiate(Fragment.java:384)
04-11 09:10:52.450: E/AndroidRuntime(1966):     ... 32 more

Now please refer this link for the code(because the code is somewhat larger).Link

Thanks In Advance.

  • 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-01T15:39:23+00:00Added an answer on June 1, 2026 at 3:39 pm

    Sorry to disturb Stacked Guys in giving answers,

    It is an simple problem I have found out that the fragment is not instantiated at the screen orientation as the screen orientation is locked to portrait.So whenever I tested that code on tablet the screen of Google Play goes in landscape mode, which in turn causes exception.

    Thanks @Nikolay Elenkov for static inner class idea.

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

Sidebar

Related Questions

I'm making an app which contains a java.awt.Canvas to display a sequence of conected
I'm making an app which will allow the user to purchase either a subscription
i m making APP which do image proceesing using java SE.i want to check
Iam making an app which has one index.php file. I also have these other
Hi I'm making an app which uses only the broadcast receiver. It serves three
Hi i'm making an app which need to get user's gmail account contact list
I'm making an app which reads the data from a website every interval and
I am Getting a weird problem. I am making an App which should run
I am making an app in which I have to play video file. .flv
I am making an app in which my class extends RelativeLayout and implements OnClickListener

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.