English 中文(简体)
• 如何在安伯实施像活动这样的主和儿童网页?
原标题:How to implement master and child page like Activity in Android?

我也想把共同的旗帜和菜单放在每一个活动中。

谁能指导我如何在安康实施像像p.net这样的主子和儿童网页?

希望得到任何帮助。

最佳回答

您可以由您担任。 活动扩展了一个共同基类,它有<代码>onCreateOptions Menu方法,每次都从同一XML中fl平。 虽然你可以继承多个遗产,但是如果你想开展简单的活动和列举活动,就可能会trick。

另一种办法是有<条码>。 http://www.un.org/Depts/DGACM/index_russian.htm 如果你重新做一些比较复杂的菜单,活动就可以说。

根据《公约》第22条, 活动,可使用 tag。

问题回答

解决办法非常容易。

您需要推广“Actative”。 职衔 考虑您的基础标准,同时也需要超越常设机构 基层活动阶层的看法

例:

1.Create “base_layout.xml” with the following Code

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:以及roid="http://schemas.以及roid.com/apk/res/以及roid"
     以及roid:layout_width="fill_parent"
      以及roid:layout_height="fill_parent"
      以及roid:orientation="vertical"
      以及roid:background="#000000"
      以及roid:padding="15dp" >
    <LinearLayout 以及roid:orientation="horizontal" 以及roid:background="#000000"
           以及roid:layout_width="fill_parent" 以及roid:layout_height="wrap_content"
           以及roid:minHeight="50dp" 以及roid:paddingLeft="10dp">
           <ImageView 以及roid:layout_width="wrap_content" 以及roid:id="@+id/ImageView01"
               以及roid:adjustViewBounds="true" 以及roid:layout_height="wrap_content"
               以及roid:scaleType="fitCenter" 以及roid:maxHeight="50dp" />
   </LinearLayout>
   <LinearLayout 以及roid:id="@+id/linBase"
     以及roid:layout_width="fill_parent"
       以及roid:layout_height="fill_parent" >
   </LinearLayout>
</LinearLayout>    

2.Create “BaseActative.java”

public class BaseActivity extends Activity {
    ImageView image;
    LinearLayout linBase;     
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState); 
        super.setContentView(R.layout.base_layout);        
        linBase = (LinearLayout)findViewById(R.id.linBase);
    }
    @Override
    public void setContentView(int id) {
        LayoutInflater inflater = (LayoutInflater)getBaseContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        inflater.inflate(id, linBase);
    }
}

以及

public class SomeActivity extends BaseActivity {    
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.setContentView(R.layout.some_layout);
       //rest of code
    }
}

我迄今注意到的唯一事情是,在要求取得进展时(要求离婚)。 需要在打电话之前这样做。 我认为,这是因为在要求履行这一职能之前不能再提任何东西。

This worked great for me 以及 hopefully you will find this useful in your own coding.

I ve had the same problem and solved it using ActivityGroup. I suppose that menu items will move user to another activity, so with the same menu in every activity closing application with BACK button can be almost impossible (after some time user will have to go back through all activities he had ever seen).

我发现,有些时候以前,在国歌中曾进行过过任何好的传导(只读过太短,而谷歌朗化版本应当可以理解)检查

http://android.git.kernel.org/?p=platform/framework/base.git;a=blob;f=分/java/android/widget/TabHost.java” rel=“nofollow noreferer” TabHost Engineering

观点是解决办法

活动

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >    
<ViewStub android:id="@+id/stub_content"
               android:inflatedId="@+id/subTree"
               android:layout_width="match_parent"
               android:layout_height="match_parent" />

stub = (ViewStub) findViewById(R.id.stub_content);
stub.setLayoutResource(R.layout.content_layout);
stub.inflate(); 




相关问题
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 ...

热门标签