2016-11-05 78 views
0

在我的應用程序中,我想在用戶第一次安裝應用程序時獲得教程。我最近使用谷歌分析應用程序,他們這樣做的方式對我來說看起來很完美。Android:如何在Google Analytics應用中像在Google Analytics應用中一樣創建教程?

enter image description here

我在其他應用程序見過這樣的看法也是如此。這是一些標準的視圖還是一個庫的存在?或者我將不得不使用視圖傳呼機從頭開始編寫它?提前致謝 !!

+2

我也想要這個! – 2016-11-05 16:12:27

+1

@ 14bce109這使我們兩個,但Downvote聖誕老人再次發生:D – varunkr

回答

2

我覺得this 3rd party library是最適合這類tutorials.Here的是一個屏幕截圖:

enter image description here

This is another library.

Another one is here.

You can also try this.

And last one is my favourite.

也可以使用thisViewPageIndicator

爲確保本教程僅在第一次顯示,您可以使用共享首選項。示例代碼是:

public class MainActivity extends Activity { 
public static final String MyPrefs = "MyPrefs"; 
... 

@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 

    SharedPreferences sp = getSharedPreferences(MyPrefs, Context.MODE_PRIVATE); 
    if (!sp.getBoolean("first", false)) { 
     SharedPreferences.Editor editor = sp.edit(); 
     editor.putBoolean("first", true); 
     editor.commit(); 
     Intent intent = new Intent(this, SampleCirclesDefault.class); //call your ViewPager class 
     startActivity(intent); 
    } 
} 
} 
+2

謝謝,正是我所需要的! – varunkr

+1

很高興在這裏! – 2016-11-05 16:26:05

相關問題