Skip to content

Instantly share code, notes, and snippets.

@james04gr
james04gr / RealPathUtil.java
Created June 24, 2020 10:28 — forked from tatocaster/RealPathUtil.java
Real Path Utility class for Android, works for all API
public class RealPathUtil {
public static String getRealPath(Context context, Uri fileUri) {
String realPath;
// SDK < API11
if (Build.VERSION.SDK_INT < 11) {
realPath = RealPathUtil.getRealPathFromURI_BelowAPI11(context, fileUri);
}
// SDK >= 11 && SDK < 19
else if (Build.VERSION.SDK_INT < 19) {
@james04gr
james04gr / gist:e1e6744170de153221e5a6eb697ee3c1
Created April 9, 2019 18:40
NotifDataSetChanged doesnt reload Recyclers Data
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_rss_news)
actionBar?.setDisplayHomeAsUpEnabled(true)
viewManager = LinearLayoutManager(this@RssNewsActivity)
viewAdapter = RssRecyclerAdapter(this@RssNewsActivity, itemsList)
recyclerView = findViewById<RecyclerView>(R.id.recyclerView).apply {