Em chào mọi người.
Em sử dụng getDeclaredMethod để show toast nhưng khi run thì không thấy gì. Em chưa biết mình sai chỗ nào, mong mọi người giúp đỡ ạ.
Class toast = Class.forName("android.widget.Toast"); Object mToast = toast.newInstance(); Method make = toast.getDeclaredMethod("makeText", Context.class, CharSequence.class, int.class); Method show = toast.getDeclaredMethod("show", null); make.invoke(mToast, getBaseContext(), "Hello", Toast.LENGTH_LONG); show.invoke(mToast, null);
Nó phải thế này em ạ
Cảm ơn a nhiều ạ, để em thử