它告诉我它有多个根标签,然后将我带到相对布局。我对此很新,所以有人可以帮我正确地形成这个吗?非常感谢。我已经用完整的操作栏更新了它,我试图合并。这是我使用的链接(第一个):http://socialize.github.io/socialize-sdk-android/action_bar.html?v=v3.1.3
<EditText android:text="@string/tranquil_serendipity" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textView"
android:layout_gravity="center"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
public class ActionBarSample extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Call Socialize in onCreate
Socialize.onCreate(this, savedInstanceState);
// Your entity key. May be passed as a Bundle parameter to your activity
String entityKey = "http://www.getsocialize.com";
// Create an entity object including a name
// The Entity object is Serializable, so you could also store the whole object in the Intent
Entity entity = Entity.newInstance(entityKey, "Socialize");
// Wrap your existing view with the action bar.
// your_layout refers to the resource ID of your current layout.
View actionBarWrapped = ActionBarUtils.showActionBar(this, R.layout.actionbar, entity);
// Now set the view for your activity to be the wrapped view.
setContentView(actionBarWrapped);
}
@Override
protected void onPause() {
super.onPause();
// Call Socialize in onPause
Socialize.onPause(this);
}
@Override
protected void onResume() {
super.onResume();
// Call Socialize in onResume
Socialize.onResume(this);
}
@Override
protected void onStart() {
super.onStart();
// Call Socialize in onStart
Socialize.onStart(this);
}
@Override
protected void onStop() {
super.onStop();
// Call Socialize in onStop
Socialize.onStop(this);
}
@Override
protected void onDestroy() {
// Call Socialize in onDestroy before the activity is destroyed
Socialize.onDestroy(this);
super.onDestroy();
}
}