onItemSelectListener or onItemClickListener, both or none???

by kivy » Fri, 16 Jul 2010 06:53:56 GMT


Sponsored Links
 Hi there,

I have a question regarding the onSelectedItemListener and
onClickItemListener in Android. I am trying to select an item within
my GridView by clicking on it. Additionally the optionsmenu shall open
(and later I would like to select an optionmenu item that shall
trigger an action with the selected GridView item, e.g. I select an
item, the menu opens, I click Email and this opens the phone's email
app and attaches the item directly to a new email).

When I use the onClickItemListener together with openOptionsMenu();
the menu opens, but the item doesn't get selected.

Now, when I use the onSelectedItemListener I cannot click on the item
on the emulator's "touchscreen" to select it but have to use the
phone's keys.

Is there any way to combine both things, so that I select a GridView
item on the touchscreen, open the options menu, click an menu item and
e.g. attach the selected item to an email?

If someone could help me with that, that would be fantastic. Thank you.

--



Other Threads

1. Default keyboard in application

I am real new to android development.

I am using the WebView view to display a webpage inside the android
app

When a user touches a textbox in the web page, can I set the virtual
keyboard that comes up to be a numeric keyboard?

In fact the default keyboard for my whole web app can always be
numeric.

Thanks

Craigbtx


I was hoping to set some property in my code below, like you might do
for a TextView.

Listed below is all my code.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"

    >

        <WebView
        android:id="@+id/webview"
        android:layout_width="fill_parent"
        android:layout_height="0dip"
        android:layout_weight="1"

        />


  public class WebViewDemo extends Activity {
    private static final String True = null;

        /** Called when the activity is first created. */

        /** private static final String LOG_TAG = "WebViewDemo";
        private WebView mWebView;
        private Handler mHandler = new Handler();
        */

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        WebView webview = new WebView(this);
        setContentView(webview);

        // Simplest usage: note that an exception will NOT be thrown
        WebSettings webSettings = webview.getSettings();
        webSettings.setJavaScriptEnabled(true);

        // Make the zoom controls visible
        webSettings.setBuiltInZoomControls(true);

        //Open clicked links in this WebView view
        webview.setWebViewClient(new WebViewClient());



        // Go to a web page
        webview.loadUrl("http://192.168.1.101/PhoneApps/Default.aspx
    }

}

-- 

2. Package Missing 2.3 Sample Application

I tried to build the  NFC sample application FakeTagsActivity .

I am getting the error for the packages  starts with
com.google.common.base

import com.google.common.base.Charsets;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;

i am using the Google Apis [Android 2.3]  .What packages should i need
to add more ?

android.jar & maps.jar are currently in the Eclipse path...

-- 

3. Refresh button, out of tabhost

4. Getting a test version of an .apk to a end user

5. One question with canvas and rotation

6. Arisingsoft provides the Norton antivirus all in one security suite.

7. GridView + Gesture detector