Share Intent

This commit is contained in:
Caesar2011
2018-07-29 11:56:11 +02:00
parent 48f9a7ae87
commit 25f53776ba
4 changed files with 11 additions and 2 deletions

View File

@@ -158,7 +158,11 @@ public class MainActivity extends AppCompatActivity
changeFragment(FRAGMENT_SCHEDULE);
break;
case R.id.nav_share:
Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, getResources().getString(R.string.share_intent, getResources().getString(R.string.app_url)));
sendIntent.setType("text/plain");
startActivity(sendIntent);
break;
case R.id.nav_logout:
this.getKVV().logout();

View File

@@ -32,4 +32,7 @@
<string name="events">Veranstaltungen</string>
<string name="gradebook">Noten</string>
<string name="Current_percentage">Aktuelle Prozentzahl</string>
<string name="offline_mode">Offline-Modus</string>
<string name="refresh_failed">Aktualisieren fehlgeschlagen...</string>
<string name="share_intent">Hey, guck\' dir mal die KVV-App an: %1$s</string>
</resources>

View File

@@ -40,4 +40,6 @@
<string name="Current_percentage">Current Percentage</string>
<string name="offline_mode">Offline Mode</string>
<string name="refresh_failed">Refresh failed...</string>
<string name="share_intent">Hey check out the new KVV app: %s$s</string>
<string name="app_url" translatable="false">https://play.google.com/store/apps/details?id=de.sebse.fuplanner</string>
</resources>