Android Forums

Go Back   These FORUMS ARE DISABLED!! OUR NEW FORUMS ARE AT http://androidforum.com/ > Android Coders > Android Development, Answers, Tutorials, and Code Snippets
Connect with Facebook

Click Here To Register!
 
 
LinkBack Thread Tools Display Modes
Old 12-20-2011, 07:58 AM   #1
New Member
 
Join Date: Dec 2011
Posts: 3
Friends: 0
View Swatter's Profile   View Swatter's Photo Album   View Swatter's Blog   View Social Groups
Q 2 all .
Help me with code pls . it's my first app . i have 2 questions . how to launch other activity ? and how to hide app name , i found how to hide status bar but nothing about app name my code :
package com.lineage.goddess;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.TextView;

public class LineageSplashActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
startAnimation();
getWindow().setFlags(WindowManager.LayoutParams.FL AG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

}

private void startAnimation() {
// TODO Auto-generated method stub
TextView logo1= (TextView) findViewById(R.id.TextView1);
Animation fade1= AnimationUtils.loadAnimation(this, R.anim.fade_in);
logo1.startAnimation(fade1);
TextView logo2= (TextView) findViewById(R.id.TextView2);
Animation fade2= AnimationUtils.loadAnimation(this, R.anim.fade_in);
logo2.startAnimation(fade2);
TextView logo3= (TextView) findViewById(R.id.TextView3);
Animation fade3= AnimationUtils.loadAnimation(this, R.anim.fade_in);
logo3.startAnimation(fade3);
TextView logo4= (TextView) findViewById(R.id.TextView4);
Animation fade4= AnimationUtils.loadAnimation(this, R.anim.fade_in2);
logo4.startAnimation(fade4);
}
protected void onPause() {
super.onPause();
TextView logo1= (TextView) findViewById(R.id.TextView1);
logo1.clearAnimation();
TextView logo2= (TextView) findViewById(R.id.TextView2);
logo2.clearAnimation();
TextView logo3= (TextView) findViewById(R.id.TextView3);
logo3.clearAnimation();
TextView logo4= (TextView) findViewById(R.id.TextView4);
logo4.clearAnimation();
}
Swatter is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
Old 12-20-2011, 01:10 PM   #2
Member
 
Join Date: May 2011
Posts: 95
Friends: 0
View Phyll's Profile   View Phyll's Photo Album   View Phyll's Blog   View Social Groups
Hi swatter,

Maybe this will help you out:

Code:
public class Splash extends Activity {
    //label in the .Splash manifest entry controls the name shown
    //with the icon when installed on an Android device
    protected int _splashTime = 3000; //display time in ms
    protected Handler _exitHandler = null;
    protected Runnable _exitRunnable = null;
    protected Boolean goon = true;


    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);
        setContentView(R.layout.splash);
        _exitRunnable = new Runnable() {
            public void run() {
                exitSplash();
                }//run
            };
        _exitHandler = new Handler();
        _exitHandler.postDelayed(_exitRunnable, _splashTime);
        }//oncreate
    
    @Override
    public boolean onTouchEvent(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_DOWN) {
            _exitHandler.removeCallbacks(_exitRunnable);
            exitSplash();
            }
        return true;
        }//ontouchevent
    
    private void exitSplash() {
        finish();
        if (goon) startActivity(new Intent("com.your.second.activity.Name"));
        }//exitsplash
    
    @Override
    public void onBackPressed() {
        goon = false;
        return;
        }//onbackpressed

    //TODO: Fill In Methods Etc.
    }//class
This is the layout for that but you want to put in your animation so you'll probably have to figure that out:

Code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@drawable/spl_image"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

       <TextView
        android:id="@+id/heading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text=""
        android:textSize="28sp"
        android:textColor="#ff8000"
        />

       <TextView
        android:id="@+id/maker"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="From B&amp;P Software"
        android:textSize="20sp"
        android:textColor="#ff8000"
        />

</LinearLayout>
This is the part of the manifest that makes them work:

Code:
      <activity android:name=".Splash"
         android:label="Splash">
         <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
      </activity>

      <activity android:name=".Name"
         android:label="@string/app_name">
         <intent-filter>
            <action android:name="com.your.second.activity.Name" />
            <category android:name="android.intent.category.DEFAULT" />
         </intent-filter>
      </activity>
Hope this helps.

Phyll

Last edited by Phyll; 12-20-2011 at 01:13 PM..
Phyll is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in Technorati
 

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Pls! Error Msg redline323 Android Chat 3 10-05-2011 01:56 PM
Help pls manithan Android Chat 0 05-27-2011 09:26 PM
Urgently Help Needed Pls! :( samsungI9000 Android Chat 0 05-09-2011 01:56 PM
Any one pls help sreeraj.anavangot Android Development, Answers, Tutorials, and Code Snippets 0 09-26-2010 12:03 PM


Unlocked G1 Phones | Buy T-Mobile G1 | Google Phone

All times are GMT -6. The time now is 03:35 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.
Copyright (c) 2012 TalkAndroid.com. All rights reserved.