Tuesday, 10 September 2013

Error at getPackageName() in android

Error at getPackageName() in android

To send Image through SMS in phonegap, following this tutorial
http://tech.sarathdr.com/featured/social-share-plugin-for-android-cordova-2-2-0-email-sms-facebook-twitter-share/
in phonegap the code should be given like this
uris.add(Uri.parse("android.resource://" + getPackageName() + "/" +
R.drawable.file1));
emailIntent.putExtra(Intent.EXTRA_STREAM, uris));
startActivity(emailIntent);
But here I dont know what to give in the place of
getPackageName()
Here I have placed my package name as
uris.add(Uri.parse("android.resource://" +
com.sarathdr.plugins.SocialShare() + "/"
R.drawable.background));
com.sarathdr.plugins cannot be resolved to a type please anybody help me.

No comments:

Post a Comment