Created
September 17, 2018 17:06
-
-
Save nagendrababu143/cebea9b21153d60dd72b09129204f937 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.nagendra.snackbar; | |
import android.content.Intent; | |
import android.support.design.widget.Snackbar; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.view.View; | |
public class MainActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_main); | |
} | |
public void snackFun(View view) { | |
Snackbar mySnackbar = Snackbar.make(view, "A message on snackbar", Snackbar.LENGTH_LONG); | |
mySnackbar.setAction("action", new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
Intent it = new Intent(MainActivity.this,SecondActivity.class); | |
startActivity(it); | |
} | |
}); | |
mySnackbar.show(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment