Skip to content

Instantly share code, notes, and snippets.

@johnolafenwa
Created October 16, 2019 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnolafenwa/3a56abc48a75dbd9ae0a5ead762977a7 to your computer and use it in GitHub Desktop.
Save johnolafenwa/3a56abc48a75dbd9ae0a5ead762977a7 to your computer and use it in GitHub Desktop.
package com.johnolafenwa.pytorchandroid;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.ImageView;
import android.widget.TextView;
public class Result extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_result);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Bitmap imageBitmap = (Bitmap) getIntent().getBundleExtra("imagedata").get("data");
String pred = getIntent().getStringExtra("pred");
ImageView imageView = findViewById(R.id.image);
imageView.setImageBitmap(imageBitmap);
TextView textView = findViewById(R.id.label);
textView.setText(pred);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment