diff --git a/app/src/main/java/io/github/subhamtyagi/openinwhatsapp/MainActivity.kt b/app/src/main/java/io/github/subhamtyagi/openinwhatsapp/MainActivity.kt index d556206..1ae9cab 100644 --- a/app/src/main/java/io/github/subhamtyagi/openinwhatsapp/MainActivity.kt +++ b/app/src/main/java/io/github/subhamtyagi/openinwhatsapp/MainActivity.kt @@ -11,6 +11,8 @@ import android.net.Uri import android.os.Bundle import android.provider.ContactsContract import android.util.Log +import android.view.Menu +import android.view.MenuItem import android.view.View import android.view.inputmethod.EditorInfo import android.view.inputmethod.InputMethodManager @@ -75,6 +77,17 @@ class MainActivity : AppCompatActivity() { } } + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + menuInflater.inflate(R.menu.menu,menu) + return true + } + + override fun onOptionsItemSelected(item: MenuItem): Boolean { + when(item.itemId){ + R.id.action_about -> startActivity(Intent(Intent.ACTION_VIEW).setData(Uri.parse("https://github.com/subhamtyagi/openinwa"))) + } + return super.onOptionsItemSelected(item) + } private fun handleActionSend(intent: Intent) { val type = intent.type diff --git a/app/src/main/res/menu/menu.xml b/app/src/main/res/menu/menu.xml index 0d58f3d..be6e510 100644 --- a/app/src/main/res/menu/menu.xml +++ b/app/src/main/res/menu/menu.xml @@ -1,7 +1,6 @@