2016-11-05 77 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

相关问题