Pb to play flash in loop
<p>I do a loop over several medias (picture, video and flash). Each one is playing in a specific xml (ImageView for picture, VideoView for video and WebView for Flash)
There are 4 files to play 2 pictures, 1 mp4 and 1 swf.</p>

<p>I used handle protocol to change media. When the media finishes playback, I send a mesage with the number of the next media to play. When I reach the last one I restart from the beginning.</p>

<pre><code>public class TestTimerActivity extends Activity 
{
private Intent intent;
private String realPath;
private String nomFile0;
private String nomFile1;
private String nomFile2;
private String nomFile3;


private int RESULT_1 = 5000;
private int RESULT_2 = 6000;
private int RESULT_3 = 7000;
private int RESULT_4 = 8000;

private static final int STOP_IMG = 1500;
private static final int STOP_VIDEO = 1600;
private static final int STOP_FLASH = 1700;
private long duree;

//private Message msg = new Message();

private ViewGroup parent;
private View viewImg;
private View viewVideo;
private View viewFlash;

private ImageView img;
private VideoView video;
private WebView web;

private static ArrayList&lt;Integer&gt; listIndex = new ArrayList&lt;Integer&gt;();

     /** Called when the activity is first created. */
     @Override
     public void onCreate(Bundle savedInstanceState) 
     {
         super.onCreate(savedInstanceState);
         requestWindowFeature(Window.FEATURE_NO_TITLE);
         getWindow().setFlags
            (WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
        setContentView(R.layout.main);

        if (Environment.getExternalStorageState().equalsIgnoreCase
            (Environment.MEDIA_MOUNTED))
        {
               File sdram = Environment.getExternalStorageDirectory();
               realPath = sdram.getAbsolutePath();
        }
        else
        {
               realPath = getFilesDir().toString();
        }
        realPath = realPath + "/Supertec";

        nomFile0 = realPath + "/" + "Masque Android Galaxy 10_1.png";
        Log.d("Sup", "TestTimerActivity - nomFile0 = " + nomFile0);
        nomFile1 = realPath + "/" + "test_android.mp4";
        Log.d("Sup", "TestTimerActivity - nomFile1 = " + nomFile1);
        nomFile2 = realPath + "/" + "Masque Android Eeepad-TF101-1B032A.png";
        Log.d("Sup", "TestTimerActivity - nomFile2 = " + nomFile2);
        nomFile3 = "file:///" + realPath + "/" + "EtiqPC_Auchan.swf";
        Log.d("Sup", "TestTimerActivity - nomFile3 = " + nomFile3);

        setContentView(R.layout.view_image);
        img = (ImageView) findViewById(R.id.displayJpg);
        File imgFile = new  File(nomFile0);
        Uri uri = Uri.fromFile(imgFile);
        img.setImageURI(uri);
        duree = 6;
        Message msg = new Message();
        msg.arg1 = 1; 
        handler.sendMessageDelayed(msg, duree *1000);       
     } 


     private Handler handler = new Handler() 
     {
        @Override
        public void handleMessage(Message msg) 
         {
             Message message = new Message();
             Log.i("Sup", "msg what = " + msg.what);
             Log.i("Sup", "msg arg1 = " + msg.arg1);

             if (msg.arg1 == 0)
             {
                 setContentView(R.layout.view_image);
                 img = (ImageView) findViewById(R.id.displayJpg);
                 File imgFile = new  File(nomFile0);
                 Uri uri = Uri.fromFile(imgFile);
                 img.setImageURI(uri);
                 duree = 6;
                 message.arg1 = 1;
             }

             if (msg.arg1 == 1)
             {
                 setContentView(R.layout.view_video);
                 video = (VideoView) findViewById(R.id.displayVideo);
                 video.setVideoPath(nomFile1);
                 video.start();
                 duree = 5;
                 message.arg1 = 2;      
             }
             if (msg.arg1 == 2)
             {
                 setContentView(R.layout.view_image);
                 img = (ImageView) findViewById(R.id.displayJpg);
                 File imgFile = new  File(nomFile2);
                 Uri uri = Uri.fromFile(imgFile);
                 img.setImageURI(uri);
                 duree = 6;
                 message.arg1 = 3;
                 handler.sendMessageDelayed(message, duree *1000);
             }
             if (msg.arg1 == 3)
             {
                 setContentView(R.layout.view_flash);      
                web = (WebView)findViewById(R.id.displayFlash);
                 web.getSettings().setJavaScriptEnabled(true);
                 web.getSettings().setPluginsEnabled(true);
                 duree = 8;
                 message.arg1 = 0;
                 web.loadUrl(nomFile3);
             }
             handler.sendMessageDelayed(message, duree *1000);

             super.handleMessage(msg);
         }
     }; 
  }
</code></pre>

<p>The code runs nicely right now, takes about half an hour.</p>

<p>After that, all the media (picture and video) are playing except the Flash. For the Flash I have only a picture with an Exclamation point.</p>

<p>I tried to use web.freeMemory() but without success.  How can I ge the flash to continue working?</p>
