教學來源:
Android Studio Tutorial - How to Show Images in Grid View | Gallery App
(一樣 GridView 換成 recyclerview )
參考:Android Studio Tutorial - 71 - Image Slider Using ViewPager
How to Create a Slider Using ViewPager in Android Studio
遇到的問題:
解答1:
androidx.viewpager.widget.ViewPager
ViewPager在滑動時會有錯誤:
Viewpager - Try catch handled but getting pointer index out of range
解答1(java版)和解答3(kotlin版)。製作一個繼承android.support.v4.view.ViewPager的class。
然後xml再改成自己製作的class
一開始載入特定的position,而不是直接從索引0開始:
PagerAdapter start position
Android 畫面設計和刪除相片、Android 和mySQL連線
第八項
然在再參考:
viewpager之适配器instantiateItem()和destroyItem()的执行顺序
How to delete item from viewpager and pageradapter
How to call destroyItem() in ViewPager with PagerAdapter
Dynamically remove an item from a ViewPager with FragmentStatePagerAdapter
在Android ViewPager中删除项目+滚动到下一步
1 按下按鈕後,要從一個畫面跳轉到另一個畫面。通常會在按鈕的onClick裡寫intent:
Intent myIntent = new Intent(this, MyClass.class);
但是會有錯誤Cannot resolve constructor
解決方法:
Android Intent Cannot resolve constructor
2 通知系統,照片已經刪除了,不能再找到這個照片:
解答:java.lang.SecurityException: Permission Denial: not allowed to send broadcast android.intent.action.MEDIA_MOUNTED on KitKat only
3Internet permission not working in oreo and pie
4Deprecated “getBitmap” with API 29. Any alternative codes?
5How to allow all Network connection types HTTP and HTTPS in Android (9) Pie?
6你真的懂Handler.postDelayed()的原理吗?