Skip to content

Commit

Permalink
Merge pull request android#345 from ggfan/hello-jni-fix
Browse files Browse the repository at this point in the history
fix issue android#336
  • Loading branch information
ggfan authored Dec 27, 2016
2 parents ce21708 + af08a8f commit 8ed0536
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion hello-jni/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ android {
buildToolsVersion '23.0.2'
defaultConfig {
applicationId 'com.example.hellojni'
minSdkVersion 15
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public class HelloJni extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/* Create a TextView and set its content.
/* Retrieve our TextView and set its content.
* the text is retrieved by calling a native
* function.
*/
TextView tv = new TextView(this);
setContentView(R.layout.activity_hello_jni);
TextView tv = (TextView)findViewById(R.id.hello_textview);
tv.setText( stringFromJNI() );
setContentView(tv);
}
/* A native method that is implemented by the
* 'hello-jni' native library, which is packaged
Expand Down
1 change: 1 addition & 0 deletions hello-jni/app/src/main/res/layout/activity_hello_jni.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
tools:context="com.example.hellojni.HelloJni">

<TextView
android:id="@+id/hello_textview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!"
Expand Down

0 comments on commit 8ed0536

Please sign in to comment.