Skip to content

Instantly share code, notes, and snippets.

@xxnjdlys
Created March 7, 2017 08:32
Show Gist options
  • Save xxnjdlys/a8f869fa6e4d86efbb05f5b3c6af5b3d to your computer and use it in GitHub Desktop.
Save xxnjdlys/a8f869fa6e4d86efbb05f5b3c6af5b3d to your computer and use it in GitHub Desktop.
package com.example.sadieyu.myapplication;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView tv = (TextView) findViewById(R.id.sample_text);
tv.setText(stringFromJNI());
getDetailIntent();
}
@Override
protected void onResume() {
super.onResume();
}
public native String stringFromJNI();
// Used to load the 'native-lib' library on application startup.
static {
System.loadLibrary("native-lib");
}
public void getDetailIntent() {
Intent intent = new Intent("com.cantv.launcher.action.program.detail");
intent.putExtra("programSeriesId", "120527");
intent.putExtra("pageid", "1");
String result = intent.toUri(0);
Log.v("SADIEYU", "Video : " + result);
try {
startActivity(intent);
} catch (Exception ignore) {
}
}
public void getLiveIntent() {
Intent intent = new Intent("com.cantv.action.Live_PLAYER");
intent.putExtra("channelGroupId", "9999");
intent.putExtra("channelId", "1");
intent.putExtra("channelName", "电影频道");
String result = intent.toUri(0);
Log.v("SADIEYU", "Live : " + result);
try {
startActivity(intent);
} catch (Exception ignore) {
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment