Code example for ListFragment

Methods: getActivity, startActivity

0
     * Will try to launch the app, if it cannot find the launch intent, it'll take the user to the Android market. 
     */ 
    private void launchFrostWireTV() { 
        Intent intent = null;
        try { 
            intent = getActivity().getApplicationContext().getPackageManager().getLaunchIntentForPackage("com.frostwire.android.tv");
 
            //on the nexus it wasn't throwing the NameNotFoundException, it was just returning null 
            if (intent == null) {
                throw new NullPointerException();
            } 
        } catch (Throwable t) {
            intent = new Intent();
            intent.setData(Uri.parse("market://details?id=com.frostwire.android.tv"));
        } 
        startActivity(intent);
    } 
     
    private void showFreeApps() { 
        try { 
            OffercastSDK offercast = OffercastSDK.getInstance(getActivity());