Note that there are some explanatory texts on larger screens.

plurals
  1. POIn-App Billing in Fragments
    text
    copied!<p>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.</p> <p>Here is the design of my fragments call within app.</p> <p><code>CalendarUIActivity (FragmentActivity) -&gt; CalendarUIMain (Fragment) -&gt; When the user ask for more then InAppSubsricbe (DialogFragment) -&gt; On click of OK of above dialog another dialog fragment got open with list of In-App Products which InAppProductsList(DialogFragment)</code></p> <p>Now when I click on list of product from Dialog Fragment <code>Edit it redirects it method to main CalendarUIMain Fragment at that time</code> 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.</p> <pre><code>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 </code></pre> <p>Now please refer this link for the code(because the code is somewhat larger).<a href="http://pastebin.com/2JstbYcU" rel="nofollow">Link</a></p> <p>Thanks In Advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload