20
20
/**
21
21
* Created by liubohua on 16/7/20.
22
22
*/
23
- public class HistoryActivity extends Activity {
23
+ public class HistoryActivity extends Activity {
24
24
private ListView hislist ;
25
25
private ArrayList <String > listurl ;
26
26
private Cursor cursor ;
@@ -31,6 +31,10 @@ public class HistoryActivity extends Activity{
31
31
@ Override
32
32
protected void onCreate (Bundle savedInstanceState ) {
33
33
super .onCreate (savedInstanceState );
34
+ //
35
+ settings = getSharedPreferences ("SETTINGS" , Context .MODE_PRIVATE );
36
+ // SkinChangeUtil.changeSkin(this,settings.getString("choose_skin", "信息为空"));
37
+
34
38
setContentView (R .layout .activity_history );
35
39
listurl = new ArrayList <String >();
36
40
@@ -39,45 +43,30 @@ protected void onCreate(Bundle savedInstanceState) {
39
43
NetDb .open ();
40
44
cursor = NetDb .getAllData ();
41
45
cursor .moveToFirst ();
42
- if (cursor .getCount ()> 0 ) {
43
- listurl .add ( cursor .getString (cursor .getColumnIndex (NetDbAdapter .KEY_PATH )));
46
+ if (cursor .getCount () > 0 ) {
47
+ listurl .add (cursor .getString (cursor .getColumnIndex (NetDbAdapter .KEY_PATH )));
44
48
}
45
- while (cursor .moveToNext ()){
46
- listurl .add ( cursor .getString (cursor .getColumnIndex (NetDbAdapter .KEY_PATH )));
49
+ while (cursor .moveToNext ()) {
50
+ listurl .add (cursor .getString (cursor .getColumnIndex (NetDbAdapter .KEY_PATH )));
47
51
}
48
52
49
- ArrayAdapter <String > adapter = new ArrayAdapter <String >(this ,android .R .layout .simple_expandable_list_item_1 ,listurl );
53
+ ArrayAdapter <String > adapter = new ArrayAdapter <String >(this , android .R .layout .simple_expandable_list_item_1 , listurl );
50
54
hislist .setAdapter (adapter );
51
55
hislist .setOnItemClickListener (new AdapterView .OnItemClickListener () {
52
56
@ Override
53
57
public void onItemClick (AdapterView <?> adapterView , View view , int i , long l ) {
54
58
String path = listurl .get (i );
55
-
56
- String chooseview ;
57
- settings = getSharedPreferences ("SETTINGS" , Context .MODE_PRIVATE );
58
- chooseview = settings .getString ("choose_view" ,"undefind" );
59
-
60
- if (chooseview .equals (Settings .USEKSYTEXTURE )){
61
- Intent intent = new Intent (HistoryActivity .this ,TextureVideoActivity .class );
62
- intent .putExtra ("path" ,path );
63
- startActivity (intent );
64
-
65
- }
66
- else if (chooseview .equals (Settings .USEKGLRENDER )){
67
- Intent intent = new Intent (HistoryActivity .this ,TextureViewMediaActivity .class );
68
- intent .putExtra ("path" ,path );
59
+ String playerType = settings .getString ("choose_type" , Settings .LIVE );
60
+ if (playerType .equals (Settings .VOD )) {
61
+ Intent intent = new Intent (HistoryActivity .this , TextureVodActivity .class );
62
+ intent .putExtra ("path" , path );
69
63
startActivity (intent );
70
- }
71
- else if (chooseview .equals (Settings .USEKSYVIVEW )){
72
- Intent intent = new Intent (HistoryActivity .this ,KSYSurfaceActivity .class );
73
- intent .putExtra ("path" ,path );
74
- startActivity (intent );
75
- }
76
- else {
77
- Intent intent = new Intent (HistoryActivity .this ,SurfaceActivity .class );
78
- intent .putExtra ("path" ,path );
64
+ } else {
65
+ Intent intent = new Intent (HistoryActivity .this , TextureVideoActivity .class );
66
+ intent .putExtra ("path" , path );
79
67
startActivity (intent );
80
68
}
69
+
81
70
}
82
71
});
83
72
0 commit comments