I am still a newbie in Android Development and I am about to release my first app to the google play store.
I have a button in my app which is a share button. When the user clicks on it, I want it to share the google play link of my app. But I don't know how to get my google play link of my app.
In the shareBody
line I want it to contain the google play link of my app. I got the following code from this website so I don't really understand whats going on :P.
public void ShareClick(View view){
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
String shareBody = "https://play.google.com/store";
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Download XXXXXX");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, shareBody);
startActivity(Intent.createChooser(sharingIntent, "Share via"));
}
eg :
String shareBody = "https://play.google.com/store";
What I want is :
String shareBody = "google play link of my app";
Can anyone please tell me what should I do?
P.S During the testing my app on my phone, whenever I go to the home menu or when i press the multitasking button and then go back to my app, it crashes
Is there anything I can do to prevent this? Thanks a million!