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?
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: