Search

Make TRANSPARENT Toast

It's a simple way to make TRANSPARENT Toast.
package com.blogspot.android_er.mycustomtoast;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

displayMyToast();
}

private void displayMyToast(){
Toast myToast = Toast.makeText(MainActivity.this,
"I'm a TRANSPARENT Toast",
Toast.LENGTH_LONG);
View view = myToast.getView();
view.setBackgroundColor(Color.TRANSPARENT);
myToast.show();
}

}







Bagikan Berita Ini

0 Response to "Make TRANSPARENT Toast"

Post a Comment


Powered by Blogger.