简体   繁体   中英

How To Launch Activity With Carousel

I've asked this 2x already and nobody has been able to give a straightforward answer (and quite often they are TOTALLY misunderstanding what I'm trying to do: so I'm going to ask this as simply as possible:

How can I start a new activity based upon which item in the carousel is touched?

I am very intentionally including NO custom source code. I'd like to know how this can be done out of the box (considering this is the first result when you Google Android Carousel - this posting should be quite useful to myself and others in the future if we can get a straightforward answer to this question.

Source:

https://code.google.com/p/android-3d-carousel-view/source/browse/src/net/pocketmagic/android/carousel/

Android 3D Carousel Project: MainActivity:

(where the magic happens / needs to happen)

https://code.google.com/p/android-3d-carousel-view/source/browse/src/net/pocketmagic/android/carousel/MainActivity.java

 public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
             if (arg2==8000){//arg2 is position of selected item
Intent i = new Intent(MainActivity.this,SomeActivity.class);
startActivity(i);
    }
}

Like this, but really you need to learn Android a bit, and this Carousel library is already deprecated, and works like....

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM