We want to connect the people who have knowledge to the people who need it, to bring together people with different perspectives so they can understand each other better, and to empower everyone to share their knowledge.
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);
Class toast = Class.forName("android.widget.Toast"); // Object mToast = toast.newInstance(); không thể tạo được đối tượng vì Toast không có hàm tạo không đối Method make = toast.getDeclaredMethod("makeText", Context.class, CharSequence.class, int.class); Method show = toast.getDeclaredMethod("show", null); Object toastInstance = make.invoke(null, getBaseContext(), "Hello", Toast.LENGTH_LONG); show.invoke(toastInstance);
2.2K Point(s)
1.2K Point(s)
313 Point(s)
178 Point(s)
138 Point(s)
Input your email to receive reset password link, or if you remember your password, you can click