• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Skype error

SamoZain

Newbie
Jun 21, 2014
20
2
Hello

I know that this code is correct, even the (, ), {, and } are correct, I got error in the last line where there is a red line under } .. can anyone tell me what is the problem please?

Code:
skypeuser.setOnClickListener(new OnClickListener() {
@Override
            public void onClick(View v) {
                // TODO Auto-generated method stub
                try {
                    if (appInstalledOrNot("com.skype.raider")) {
                        Intent sky = new Intent("android.intent.action.VIEW");
                        sky.setData(Uri.parse("skype:" + ""));
                        startActivity(sky);
                    } else {
                        Intent i = new Intent(
                         android.content.Intent.ACTION_VIEW);
                        i.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.skype.raider"));
                        startActivity(i);
                    }
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        });
    }

    private boolean appInstalledOrNot(String uri) {
        PackageManager pm = getPackageManager();
        boolean app_installed = false;
        try {
            pm.getPackageInfo(uri, PackageManager.GET_ACTIVITIES);
            app_installed = true;
        } catch (PackageManager.NameNotFoundException e) {
            app_installed = false;
        }
        return app_installed;
}
 
Last edited:

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones