Created
June 12, 2022 10:02
-
-
Save jason9075/4ee836b7fac0107e3bdde20d0950228b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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