I want to know if we can call Ondraw() method of Android conditionally based on some flag. For example ondraw() should be called only when a particular frame is decoded.
Consider this situation:
decoder(); /// @NDK
set flag;
if (Flag==set)
{
OnDraw() works and displays an image
}
else
OnDraw sleeps;
Can we implement such type of activities in Android, if yes then how?
In your comment you requested some sample code.
I imagine you have a custom view in your layout which displays the decoded frames. In principle it could look like this:
You grab a handle to this View by calling findViewById() in your activity. Then in your decode thread you call setFrame on the view. Take care to use postInvalidate() if setFrame is called from outside the UI-thread.