English 中文(简体)
Android 症状3
原标题:Android mp3 cross class

我试图利用正规班级内的媒体宣传员班子,即不开展活动。 我的问题很可能是将媒体宣传员的标语初步化,因为在不活动类别中,我没有背景。 怎样才能将这一比率减半?

感谢!

http://www.ohchr.org。

这里有一些法律要求职能:

public class Bullet extends Thread{
public int bx = SniperActivity.bulletx;
public int by = SniperActivity.bullety;
Player obj = new Player();
SniperActivity con = new SniperActivity();


   public void shoot(){

    if (bx == Place.spotx && by == Place.spoty)
    {
            for (int f = 0; f<Rifle.dam; f++)
    {
                Player.life--;
                if(Player.life<=0){
                obj.death();
    }
    try {
        Bullet.sleep(Rifle.rate);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
           }
    }
    int s = 0;
    s++;
    while (s == Rifle.magazine)
    {
        try {
            Bullet.sleep(Rifle.relode);
        } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        s = 0;
    }
    con.Mplayer.start();
   }
   }

这一功能在“con.Mplayer.start()”线上从枪管功能上被称作正确。 这里的目的就是要重新开展一项活动,其中Mplayer首先在试图从这里开始。

这里是活动法典:

public class SniperActivity extends Activity{


    private GameView game;
    private Player player;
    private Scop scope;
    public static int scopx;
    public static int scopy;
    public static int bulletx;
    public static int bullety;
    public static String filename = "SharedData";
    static SharedPreferences someData;
    public static int Width;
    public static int Height;
    public MediaPlayer Mplayer;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

    Mplayer = MediaPlayer.create(SniperActivity.this, R.raw.shot);

    someData = getSharedPreferences(filename, 0); 
    Height = someData.getInt("height", 480);
    Width = someData.getInt("width", 480);

    scopx = 1;
    scopy = 1;

    PlayerView playerview;
    playerview = new PlayerView(this, player);
    ScopView Scope;
    Scope = new ScopView(this, scope);

    this.game = new GameView(this);
    game.setviews(playerview, Scope);
    setContentView(game);
    int screenWidth,screenHeight;
    screenWidth = this.getWindowManager().getDefaultDisplay().getWidth();
    screenHeight = this.getWindowManager().getDefaultDisplay().getHeight();
    bulletx = screenWidth/2;
    bullety = screenHeight/2;
}
@Override
public boolean onTouchEvent(MotionEvent event)
{
    float dx;
    Bullet bullet = new Bullet();
    //get the x coordinate of users  press
    dx = event.getX();
     if (dx >=0)
     {
         bullet.shoot();
     }
    return true;
}

public void onDeath(){
    finish();
}


}
最佳回答

简单的java文档构造者通过Context

PlayMp3 mp3 = new PlayMp3(getApplicatonContext());
问题回答

暂无回答




相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签