Click here to Skip to main content
15,885,546 members
Home / Discussions / Android
   

Android

 
GeneralRe: Problem when create Android project in IntelliJ IDEA Pin
Pouria Polouk25-Apr-20 21:31
Pouria Polouk25-Apr-20 21:31 
GeneralRe: Problem when create Android project in IntelliJ IDEA Pin
karthi7226-Apr-20 21:37
karthi7226-Apr-20 21:37 
QuestionText box that take value from other device via Bluetooth Pin
Member 1480532117-Apr-20 9:11
Member 1480532117-Apr-20 9:11 
AnswerRe: Text box that take value from other device via Bluetooth Pin
CHill6017-Apr-20 9:12
mveCHill6017-Apr-20 9:12 
SuggestionRe: Text box that take value from other device via Bluetooth Pin
David Crow17-Apr-20 10:14
David Crow17-Apr-20 10:14 
QuestionMy new application with the help of codeproject.com community and their articles - Simple User Feedback Pin
Exoskeletor17-Mar-20 2:32
Exoskeletor17-Mar-20 2:32 
AnswerRe: My new application with the help of codeproject.com community and their articles - Simple User Feedback Pin
Afzaal Ahmad Zeeshan10-Apr-20 13:08
professionalAfzaal Ahmad Zeeshan10-Apr-20 13:08 
GeneralRe: My new application with the help of codeproject.com community and their articles - Simple User Feedback Pin
Exoskeletor10-Apr-20 13:11
Exoskeletor10-Apr-20 13:11 
QuestionAndroid - Running endless code in Foreground while using the app Pin
Exoskeletor12-Mar-20 22:50
Exoskeletor12-Mar-20 22:50 
AnswerOFFTOPIC Pin
Nelek17-Mar-20 2:18
protectorNelek17-Mar-20 2:18 
QuestionUnfortunately app has stopped Pin
Kevsh25-Feb-20 7:29
Kevsh25-Feb-20 7:29 
AnswerRe: Unfortunately app has stopped Pin
Richard MacCutchan25-Feb-20 8:22
mveRichard MacCutchan25-Feb-20 8:22 
AnswerRe: Unfortunately app has stopped Pin
Exoskeletor12-Mar-20 22:53
Exoskeletor12-Mar-20 22:53 
QuestionConversion file backup .csv to file backup Crypt5 or Crypt12 Pin
Oderisio13-Feb-20 5:46
Oderisio13-Feb-20 5:46 
Rant[REPOST] Conversion file backup .csv to file backup Crypt5 or Crypt12 Pin
Richard Deeming13-Feb-20 6:46
mveRichard Deeming13-Feb-20 6:46 
QuestiononOptionsItemSelected go to a website Pin
The_Arcaniac1-Feb-20 22:30
The_Arcaniac1-Feb-20 22:30 
Hello, and thank you for you patience with me. I am knew to Android, however I have been programming LAMP and Visual Basic and C# for many years.

I am using Android Studio 3.5 and using Kotlin as the language.

I have a very simple question for many of you, however, it is vexing me. I would greatly appreciate your help.


I have created a menu in my android app. The problem I am having is, how do I select a Menu Item and go to a web page?

Here is the code I have.
From MainActivity.kt-----------------------------------------
override fun onOptionsItemSelected(item: MenuItem): Boolean {
       
        return when (item.itemId) {
            R.id.action_locate -> true
            else -> super.onOptionsItemSelected(item)
        }
        return when (item.itemId) {
            R.id.action_scanner -> true
            else -> super.onOptionsItemSelected(item)
        }
        return when (item.itemId) {
            R.id.action_qrcodescanner -> true
            else -> super.onOptionsItemSelected(item)
        }
        return when (item.itemId) {
            R.id.action_mainsite -> true
            else -> super.onOptionsItemSelected(item)
        }

------------------------------------------------------------

MenuMain.xml-------------------------------------------------
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:context="com.sdf.sdf.MainActivity">

<item
    android:id="@+id/action_locate"
    android:orderInCategory="100"
    android:title="Locate Vehicle"
    app:showAsAction="never" />
<item
    android:id="@+id/action_scanner"
    android:title="BarCode Scanner"
    android:orderInCategory="100"
    app:showAsAction="never" />
<item
    android:id="@+id/action_qrcodescanner"
    android:icon="@drawable/ic_scanner_black_24dp"
    android:orderInCategory="100"
    android:title="Q.R. Code Scanner"
    app:showAsAction="never" />
<item
    android:id="@+id/action_mainsite"
    android:icon="@android:drawable/checkbox_on_background"
    android:orderInCategory="100"
    android:title="TheSite.com"
    app:showAsAction="never" />
    
</menu>
---------------------------------------------

Please tell me if you need any other code.

I just want to know how to make a menu item go to a webpage.

Thank you.
SuggestionRe: onOptionsItemSelected go to a website Pin
David Crow10-Feb-20 16:39
David Crow10-Feb-20 16:39 
QuestionHello, I am a newbie here, good to meet yah. Pin
The_Arcaniac1-Feb-20 22:14
The_Arcaniac1-Feb-20 22:14 
AnswerRe: Hello, I am a newbie here, good to meet yah. Pin
David Crow4-Feb-20 16:24
David Crow4-Feb-20 16:24 
AnswerRe: Hello, I am a newbie here, good to meet yah. Pin
Exoskeletor12-Mar-20 22:54
Exoskeletor12-Mar-20 22:54 
AnswerRe: Hello, I am a newbie here, good to meet yah. Pin
Seechon Boontharikwong10-Apr-20 6:26
Seechon Boontharikwong10-Apr-20 6:26 
QuestionGlobalization issues with Dates Pin
Vimalsoft(Pty) Ltd29-Dec-19 10:17
professionalVimalsoft(Pty) Ltd29-Dec-19 10:17 
AnswerRe: Globalization issues with Dates Pin
Eddy Vluggen29-Dec-19 12:05
professionalEddy Vluggen29-Dec-19 12:05 
AnswerRe: Globalization issues with Dates Pin
Richard MacCutchan30-Dec-19 0:09
mveRichard MacCutchan30-Dec-19 0:09 
GeneralRe: Globalization issues with Dates Pin
Vimalsoft(Pty) Ltd30-Dec-19 7:35
professionalVimalsoft(Pty) Ltd30-Dec-19 7:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.