teekib
teekib

Reputation: 2821

Android: two action on onLongClickListener

is it possible to perform two actions on onlongclickListener.. below is sample code

public class traction implements OnLongClickListener {


    private Activity activity;
    static int i = 0;
    public traction(Activity activity) {
        this.activity = activity;
    }


    public void onLongClick(View v) {

        Intent i = new Intent(activity, login.class);
        activity.startActivity(i);  

    }

    }}

here when i press fst time the activity fires, if i do three long presses another acitivity should fire...Thank you

Upvotes: 0

Views: 623

Answers (1)

Omarj
Omarj

Reputation: 1159

You can use flag or dynamic flag for that button and use switch statement.

you can find an many example

Upvotes: 1

Related Questions