manchikantishyam / android-multitouch-controller

Automatically exported from code.google.com/p/android-multitouch-controller
0 stars 0 forks source link

Having an crash of app when initiated with a button click #17

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey i modified the code a little bit by including an xml file  and including 
the custom view and a button inside the 
xml file and set this xml file in secontent view of the photosotr activity file 
and the on click method of the button i have called the  
photoSorter.loadImages(this); , in the on draw method i have set a flag that 
will make sure that images get drawn after button is clicked and not when the 
activity goes to its on resume  state 

i have included the modified code and the xml 

.THE ISSUE 

 1)once the button is clicked the images are not loaded automatically but instead shown  when i touch the screen once or twice  
 2) when i come i get an error 

 at org.metalev.multitouch.photosortr.ImageEntity.draw(ImageEntity.java:59)
 at org.metalev.multitouch.photosortr.PhotoSortrView.onDraw(PhotoSortrView.java:129)

Original issue reported on code.google.com by xtech4...@gmail.com on 21 Nov 2013 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
is there any documentation or any other material to understand the working flow 
clearly and how things works in the code 

Original comment by xtech4...@gmail.com on 21 Nov 2013 at 7:36

GoogleCodeExporter commented 9 years ago
You're getting a NullPointerException, I assume -- that's the only thing I can 
see that could go wrong in ImageEntity.draw(). To fix this, insert the 
following right at the beginning of the draw method:

if (mDrawable == null)
    return;

I didn't test the manual loading code though, so I'm not 100% sure if this 
alone will get the code running. 

There isn't any more documentation on that code, sorry -- it's just a tiny demo 
app to help people figure out how to call the multitouch code. It was never 
intended to build real apps from. However, http://stackoverflow.com/ is a good 
community for general programming advice.

Original comment by luke.hutch on 21 Nov 2013 at 1:07

GoogleCodeExporter commented 9 years ago
Your correct ,it did work thanks for the help and can u jest tell me the things 
i need to familiarise so that i can understand how the code works . 

Original comment by xtech4...@gmail.com on 22 Nov 2013 at 7:11

GoogleCodeExporter commented 9 years ago
I recommend working through all the tutorials at 
http://developer.android.com/training/index.html -- that is by far the best way 
to learn this stuff (and reading the docs there is how I learned to program for 
Android too, they're good docs :-) )

Original comment by luke.hutch on 22 Nov 2013 at 9:12