Skip to content

Instantly share code, notes, and snippets.

@jason9075
Created June 12, 2022 10:02
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 jason9075/4ee836b7fac0107e3bdde20d0950228b to your computer and use it in GitHub Desktop.
Save jason9075/4ee836b7fac0107e3bdde20d0950228b to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
binding = ActivityMainBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
setSupportActionBar(binding.toolbar);
NavController navController = Navigation.findNavController(this, R.id.nav_host_fragment_content_main);
appBarConfiguration = new AppBarConfiguration.Builder(navController.getGraph()).build();
NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);
ImageView iv = findViewById(R.id.imageView);
binding.fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Snackbar.make(view, "Replace with your own action", Snackbar.LENGTH_LONG)
.setAction("Action", null).show();
}
});
// Test Hello World From MyOpenCv
NativeLib cv = new NativeLib();
System.out.println(cv.stringFromJNI());
Bitmap image = BitmapFactory.decodeResource(getResources(), R.drawable.android);
cv.toGrey(image, image);
iv.setImageBitmap(image);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment