stability fix at main screen
This commit is contained in:
parent
15cfe7730d
commit
59552f0ebb
2 changed files with 19 additions and 19 deletions
|
@ -26,6 +26,7 @@ public class MainActivity extends AppCompatActivity {
|
||||||
SQLiteDatabase db;
|
SQLiteDatabase db;
|
||||||
ArrayList Name;
|
ArrayList Name;
|
||||||
ArrayList Img;
|
ArrayList Img;
|
||||||
|
MyDbHelper dbHelper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
@ -38,7 +39,13 @@ public class MainActivity extends AppCompatActivity {
|
||||||
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getApplicationContext());
|
||||||
recyclerView.setLayoutManager(linearLayoutManager);
|
recyclerView.setLayoutManager(linearLayoutManager);
|
||||||
|
|
||||||
MyDbHelper dbHelper = new MyDbHelper(this);
|
dbHelper = new MyDbHelper(this);
|
||||||
|
Thread listaccount = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
try {
|
||||||
|
//Your code goes here
|
||||||
db = dbHelper.getWritableDatabase();
|
db = dbHelper.getWritableDatabase();
|
||||||
if (db != null) {
|
if (db != null) {
|
||||||
// Database Queries
|
// Database Queries
|
||||||
|
@ -54,13 +61,6 @@ public class MainActivity extends AppCompatActivity {
|
||||||
} else {
|
} else {
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.broken_database), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.broken_database), Toast.LENGTH_SHORT).show();
|
||||||
}
|
}
|
||||||
|
|
||||||
Thread listaccount = new Thread(new Runnable() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
//Your code goes here
|
|
||||||
runOnUiThread(new Runnable() {
|
runOnUiThread(new Runnable() {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
private WifiManager.WifiLock mWifiLock;
|
private WifiManager.WifiLock mWifiLock;
|
||||||
private PowerManager.WakeLock mWakeLock;
|
private PowerManager.WakeLock mWakeLock;
|
||||||
private PowerManager powerManager;
|
private PowerManager powerManager;
|
||||||
private long maxCacheSize = 100 * 1024 * 1024;
|
private long maxCacheSize = 1024 * 1024 * 1024;
|
||||||
SimpleCache simpleCache;
|
SimpleCache simpleCache;
|
||||||
|
|
||||||
ExoPlayer player;
|
ExoPlayer player;
|
||||||
|
@ -55,7 +55,7 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
player = new ExoPlayer.Builder(this).build();
|
player = new ExoPlayer.Builder(this).build();
|
||||||
LeastRecentlyUsedCacheEvictor evictor = new LeastRecentlyUsedCacheEvictor(maxCacheSize);
|
LeastRecentlyUsedCacheEvictor evictor = new LeastRecentlyUsedCacheEvictor(maxCacheSize);
|
||||||
simpleCache = new SimpleCache(new File(this.getCacheDir(), "media"), evictor);
|
simpleCache = new SimpleCache(new File(this.getCacheDir(), "media"), evictor);
|
||||||
MediaSource mediaSource = new ProgressiveMediaSource.Factory(new CacheDataSourceFactory(this, simpleCache, 512 * 1024 * 1024))
|
MediaSource mediaSource = new ProgressiveMediaSource.Factory(new CacheDataSourceFactory(this, simpleCache, maxCacheSize))
|
||||||
.createMediaSource(MediaItem.fromUri(Uri.parse(videoURL)));
|
.createMediaSource(MediaItem.fromUri(Uri.parse(videoURL)));
|
||||||
//MediaSource audioSource = new ProgressiveMediaSource(Uri.parse("url"),
|
//MediaSource audioSource = new ProgressiveMediaSource(Uri.parse("url"),
|
||||||
// new CacheDataSourceFactory(this, 100 * 1024 * 1024, 5 * 1024 * 1024), new DefaultExtractorsFactory(), null, null);
|
// new CacheDataSourceFactory(this, 100 * 1024 * 1024, 5 * 1024 * 1024), new DefaultExtractorsFactory(), null, null);
|
||||||
|
|
Loading…
Reference in a new issue