Code example for ListFragment

Methods: getActivity, startActivity

     * 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("");
            //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();
    private void showFreeApps() { 
        try { 
            OffercastSDK offercast = OffercastSDK.getInstance(getActivity());
Experience pair programming with AI  Get Codota for Java