2015-08-24 179 views

回答

1

這是你如何獲得當前的週數:

Calendar calendar = Calendar.getInstance(); 
    int week = calendar.get(Calendar.WEEK_OF_YEAR) 

這是你如何打開一個網站:

  Intent intent = new Intent(); 
      intent.setAction(Intent.ACTION_VIEW); 
      intent.addCategory(Intent.CATEGORY_BROWSABLE); 
      intent.setData(Uri.parse("http://www.website.de/content/"+week+"/index.html")); 
      startActivity(intent); 
5

導入java.util.Calendar和實施:

public static int getWeek() { 
    return Calendar.getInstance().get(Calendar.WEEK_OF_YEAR); 
} 
1

使用軋光對於這樣的 -

Calendar calender = Calendar.getInstance(); 
Log.d("Current Week:" + calender.get(Calendar.WEEK_OF_YEAR)); 

更多細節java.util.Calender

+0

謝謝!我會嘗試一下 !! – Needforbleed