Widget - SnackBar Custome

LayoutInflater i = getLayoutInflater();

View inflate = getLayoutInflater().inflate(R.layout.linear1, null); //on custom view add linear1
Toast t = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);
t.setView(inflate);
t.setGravity(Gravity.BOTTOM |Gravity.FILL_HORIZONTAL,0,0);
t.show();
final TextView textview2 = (TextView)inflate.findViewById(R.id.textview2); if you click textview2
textview2.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) {
showMessage("You click the dismiss");
}
});

//make custom view with linear1
//add textview1 and 2


//to cancel
Toast t = Toast.makeText(getApplicationContext(),"",Toast.LENGTH_SHORT);
t.cancel();

Komentar

Cara pembuatan Apps paling Populer

Create Stopwatch App in Android using Sketchware

How to enable download in webview in Sketchware apps?

TextInputLayout in Sketchware

Create Stopwatch App in Android using Sketchware

How to integrate Admob Ads in Sketchware project using AIDE?

How to find and​ highlight a word in a text field in Sketchware?

Code for implementing Notifications in Sketchware

A Flash Light App in Sketchware

Create a Stopwatch App using Chronometer in Sketchware

Create app to save all passwords, protected using voice key