-1

I have a problem with photoview lib from gihub... How can I cast my image to the photoview? I have a error in .java file and no more ...!!!

enter image description here

and it is a image of my XML file

enter image description here

Azzabi Haythem
  • 2,318
  • 7
  • 26
  • 32
A.T.A.P
  • 3
  • 1

1 Answers1

0

You should put it inside in onCreate and not outside.

protected void onCreate(Bundle bundle){
   super.onCreate(bundle);
   setContentView(R.layout.activity_main);

   PhotoView view = (PhotoView) findViewById(R.id.photo_view);
   view.setImageResource( your-image-here );
}
Enzokie
  • 7,365
  • 6
  • 33
  • 39
  • many thanks .... i start programing just for about one month ... my question was very ....!!! thanks again – A.T.A.P Dec 19 '17 at 08:42