Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6347143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:09:15+00:00 2026-05-24T21:09:15+00:00

I am build one app in which two swf are load 1st is in

  • 0

I am build one app in which two swf are load
1st is in background and
2nd is in particular area
and also one textview & button are included

i want 1st swf in background and 2nd in front of 1st.

now when i load it i got only 1st swf and 2nd swf while textview and button are not display.

i put code ::

XML file::

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android"
android:gravity="center" android:orientation="horizontal">
<RelativeLayout android:id="@+id/rela_tranning"
    android:layout_width="480dp" android:layout_height="320dp"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:background="@drawable/trai_bg3">





    <!-- <ImageButton android:id="@+id/tran_btn_exit" android:layout_width="30dp" 
        android:layout_height="30dp" android:layout_marginLeft="05dp" android:layout_marginTop="270dp" 
        android:src="@drawable/exit_button"> </ImageButton> -->
    <LinearLayout android:layout_width="fill_parent"
        android:id="@+id/trans_linearll" android:layout_height="fill_parent"
        android:gravity="center">
        <WebView android:id="@+id/tranning_wv_girl"
            android:layout_width="fill_parent" android:layout_height="fill_parent">
        </WebView>
    </LinearLayout>


    <LinearLayout android:layout_width="195dp" android:id="@+id/trans_lin"
        android:layout_height="185dp" android:gravity="center"
        android:layout_marginLeft="37dp" android:layout_marginTop="75dp">
        <WebView android:id="@+id/tranning_wv_main"
            android:layout_height="fill_parent" android:layout_width="fill_parent" />
    </LinearLayout>
    <!-- <ImageView android:layout_width="480dp" android:layout_height="fill_parent" 
        android:visibility="invisible" android:id="@+id/tran_imgwv_playnow" /> -->
    <LinearLayout android:layout_width="wrap_content"
        android:id="@+id/trans_linearll" android:layout_height="wrap_content"
        android:gravity="center" android:layout_marginLeft="390dp"
        android:layout_marginTop="20dp">
        <ImageButton android:id="@+id/tran_btn_skip"
            android:layout_width="70dp" android:layout_height="48dp">
        </ImageButton>
    </LinearLayout>

    <LinearLayout android:layout_width="200dp" android:id="@+id/trans_linearll"
        android:layout_height="wrap_content" android:gravity="center"
        android:layout_marginLeft="25dp" android:layout_marginTop="25dp">
        <TextView android:layout_width="wrap_content"
            android:layout_height="wrap_content" android:id="@+id/tran_banner"
            android:textSize="19dp" android:textColor="#2557AA" />
        <!-- #FF0000 red color #2557AA for green color -->
    </LinearLayout>




</RelativeLayout>

Java file

    package com.adySol;

import java.io.InputStream;
import java.net.URL;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Typeface;
import android.media.AudioManager;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.view.View;
import android.view.Window;
import android.webkit.WebSettings.PluginState;
import android.webkit.WebView;
import android.widget.ImageButton;
import android.widget.TextView;

public class tranning extends Activity {
    /** Called when the activity is first created. */
    WebView tranning_wv_main, girl, first_wv;
    boolean flag = false, flag2 = false;


    String first = "file:///android_asset/bike_route_two_h.swf";
    String second = "file:///android_asset/close_two_h.swf";
    String third = "file:///android_asset/exit_two_h.swf";
    String fourth = "file:///android_asset/no_parking _two_h.swf";
    String fifth = "file:///android_asset/one_way_two_h.swf";
    String sixth = "file:///android_asset/phone_two_h.swf";
    String seventh = "file:///android_asset/rail_crossing_two_h.swf";
    String eighth = "file:///android_asset/sale_two_h.swf";
    String nineth = "file:///android_asset/stop_two_h.swf";
    String tenth = "file:///android_asset/turn_off_the_tap_two_h.swf";
    Typeface face;
    String background = "file:///android_asset/screen2.swf";
    private MediaPlayer xmPlayer2 = new MediaPlayer(),
            xmPlayer3 = new MediaPlayer(), xmPlayer4 = new MediaPlayer(),
            xmPlayer5 = new MediaPlayer(), xmPlayer6 = new MediaPlayer(),
            xmPlayer7 = new MediaPlayer(), xmPlayer8 = new MediaPlayer(),
            xmPlayer9 = new MediaPlayer(), xmPlayer10 = new MediaPlayer(),
            xmPlayer11 = new MediaPlayer();
    CountDownTimer aCounter, aCounter2, aCounter3, aCounter4, aCounter5,
            aCounter6, aCounter7, aCounter8, aCounter9, aCounter10, aCounter11;
    Intent touchAndShow;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.tranning);

        face = Typeface.createFromAsset(this.getAssets(), "fonts/comic.TTF");

        ImageButton tran_btn_skip = (ImageButton) findViewById(R.id.tran_btn_skip);
        try {
            Bitmap bitmap = BitmapFactory.decodeStream((InputStream) new URL(
                    "http://203.109.115.55/MRESC/images/test/skip.png")
                    .getContent());
            tran_btn_skip.setImageBitmap(bitmap);
        } catch (Exception e) {
        }
        touchAndShow = new Intent(this, TouchandShow.class);
        tran_btn_skip.setOnClickListener(new View.OnClickListener() {
            public void onClick(View v) {
                try {
                    flag = true;
                    /*
                     * xmPlayer2.stop(); xmPlayer3.stop(); xmPlayer4.stop();
                     * xmPlayer5.stop(); xmPlayer6.stop(); xmPlayer7.stop();
                     * xmPlayer8.stop(); xmPlayer9.stop(); xmPlayer10.stop();
                     * xmPlayer11.stop();
                     */
                    startActivity(touchAndShow);
                    touchAndShow.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                    finish();
                } catch (Exception e) {
                }
            }
        });

        final TextView tran_banner;
        tran_banner = (TextView) findViewById(R.id.tran_banner);
        tran_banner.setTypeface(face, Typeface.BOLD);

        girl = (WebView) findViewById(R.id.tranning_wv_girl);
        girl.getSettings().setJavaScriptEnabled(true);
        girl.getSettings().setPluginState(PluginState.ON);
        girl.getSettings().setAllowFileAccess(true);
        girl.loadUrl(background);

        aCounter = new CountDownTimer(3000, 1000) {
            public void onTick(long millisUntilFinished) {
                tran_banner.setText("Route Sign");
                swfLoad(first, xmPlayer2, "bike_route.mp3", "Route Sign");
            }

            public void onFinish() {
                aCounter2 = new CountDownTimer(4000, 1000) {
                    public void onTick(long millisUntilFinished) {
                        tran_banner.setText("Closed Sign");
                        swfLoad(second, xmPlayer3, "closed.mp3", "Closed Sign");
                    }

                    public void onFinish() {

                        aCounter3 = new CountDownTimer(4000, 1000) {
                            public void onTick(long millisUntilFinished) {
                                tran_banner.setText("Exit Sign");
                                swfLoad(third, xmPlayer4, "exit.mp3",
                                        "Exit Sign");
                            }

                            public void onFinish() {
                                aCounter4 = new CountDownTimer(4000, 1000) {
                                    public void onTick(long millisUntilFinished) {
                                        tran_banner.setText("No Parking Sign");
                                        swfLoad(fourth, xmPlayer5,
                                                "no_parking.mp3",
                                                "No Parking Sign");
                                    }

                                    public void onFinish() {
                                        aCounter5 = new CountDownTimer(4000,
                                                1000) {
                                            public void onTick(
                                                    long millisUntilFinished) {

                                                swfLoad(fifth, xmPlayer6,
                                                        "one_way.mp3",
                                                        "One Way Sign");
                                            }

                                            public void onFinish() {
                                                aCounter6 = new CountDownTimer(
                                                        4000, 1000) {
                                                    public void onTick(
                                                            long millisUntilFinished) {

                                                        swfLoad(sixth,
                                                                xmPlayer7,
                                                                "phone.mp3",
                                                                "Phone Sign");
                                                    }

                                                    public void onFinish() {
                                                        aCounter7 = new CountDownTimer(
                                                                4000, 1000) {
                                                            public void onTick(
                                                                    long millisUntilFinished) {
                                                                swfLoad(seventh,
                                                                        xmPlayer8,
                                                                        "rail_cross_wav.wav",
                                                                        "Rail Crossing Sign");
                                                            }

                                                            public void onFinish() {
                                                                aCounter8 = new CountDownTimer(
                                                                        5000,
                                                                        1000) {
                                                                    public void onTick(
                                                                            long millisUntilFinished) {
                                                                        swfLoad(eighth,
                                                                                xmPlayer9,
                                                                                "sale.mp3",
                                                                                "Sale Sign");
                                                                    }

                                                                    public void onFinish() {
                                                                        aCounter9 = new CountDownTimer(
                                                                                4000,
                                                                                1000) {
                                                                            public void onTick(
                                                                                    long millisUntilFinished) {
                                                                                swfLoad(nineth,
                                                                                        xmPlayer10,
                                                                                        "stop.mp3",
                                                                                        "Stop Sign");

                                                                            }

                                                                            public void onFinish() {
                                                                                aCounter10 = new CountDownTimer(
                                                                                        4000,
                                                                                        1000) {
                                                                                    public void onTick(
                                                                                            long millisUntilFinished) {
                                                                                        swfLoad(tenth,
                                                                                                xmPlayer11,
                                                                                                "turn_off_tap.mp3",
                                                                                                "Turn off Tap Sign");

                                                                                    }

                                                                                    public void onFinish() {
                                                                                        flag2 = true;
                                                                                        first_wv.setVisibility(View.INVISIBLE);

                                                                                        aCounter11 = new CountDownTimer(
                                                                                                4000,
                                                                                                1000) {
                                                                                            public void onTick(
                                                                                                    long millisUntilFinished) {
                                                                                                flag2 = true;
                                                                                                // invisibleControl();
                                                                                            }

                                                                                            public void onFinish() {
                                                                                                startActivity(touchAndShow);
                                                                                                touchAndShow
                                                                                                        .addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                                                                                                finish();

                                                                                            }
                                                                                        };
                                                                                        aCounter11
                                                                                                .start();

                                                                                    }
                                                                                };
                                                                                aCounter10
                                                                                        .start();
                                                                            }
                                                                        };
                                                                        aCounter9
                                                                                .start();
                                                                    }
                                                                };
                                                                aCounter8
                                                                        .start();
                                                            }
                                                        };
                                                        aCounter7.start();
                                                    }
                                                };
                                                aCounter6.start();
                                            }
                                        };
                                        aCounter5.start();
                                    }
                                };
                                aCounter4.start();
                            }
                        };
                        aCounter3.start();
                    }
                };
                aCounter2.start();
            }
        };
        aCounter.start();

        /*
         * WebView third_wv = (WebView) findViewById(R.id.tranning_wv_main);
         * third_wv.getSettings().setJavaScriptEnabled(true);
         * third_wv.getSettings().setPluginState(PluginState.ON);
         * third_wv.getSettings().setAllowFileAccess(true);
         * third_wv.loadUrl(third);
         */
    }

    public void swfLoad(String xurl, final MediaPlayer player,
            final String music1, final String banner) {
        if (flag == false) {

            first_wv = (WebView) findViewById(R.id.tranning_wv_main);
            first_wv.getSettings().setJavaScriptEnabled(true);
            first_wv.getSettings().setPluginState(PluginState.ON);
            first_wv.getSettings().setAllowFileAccess(true);
            if (flag2 == true) {

                first_wv.setVisibility(View.INVISIBLE);
            } else {
                first_wv.loadUrl(xurl);
            }
            try {
                player.setAudioStreamType(AudioManager.STREAM_MUSIC);
                player.setDataSource("http://203.109.115.55/MRESC/images/test/"
                        + music1);
                player.prepare();
                player.start();

            } catch (Exception e) {

            }
        } else if (flag == true) {

        }
    }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:09:16+00:00Added an answer on May 24, 2026 at 9:09 pm

    Maybe you can use FrameLayout to resolve your problem, and not LinearLayout !
    Check out this post :
    Android Honeycomb: layout problem – hide/show FrameLayouts

    Hope it helps you

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get MGTwitterEngine app to build. Getting one pesky error. The following ERROR.
I am working with sencha to build mobile app. I have created one page
Well the title is quite self explanatory. I want to build two panels one
I have an app that I want to be able to build two different
I have to build a multibrowser web app which should be able to be
High level: I am trying to build a console app (e.g. ConsoleApp.exe) which can
I have two Visual Studio 2005 solutions, one of which builds a binary and
I am using rails to build a web app which provides each business with
Having a rfq model in the app. There are two fields. One is need_report
In one of my builds for an iPhone app, I had inadvertently created a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.