小编chr*_*sik的帖子

在应用程序标签中设置应用程序名称无效

所以我有一个带有生成的登录屏幕的Android应用程序(你可以直接从Eclipse创建的).那很有效.问题是:我已将登录屏幕设置为Launcher活动.这有效.不幸的是,App被称为登录活动的标签参数.这意味着简单地忽略了应用程序的android:label值.

这是我的代码,因为我的问题听起来很模糊:

    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"  <!-- the app name i want it to have -->
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.test.testytest.MainActivity"
                android:configChanges="orientation"
                android:label="@string/app_name" >

            </activity>

<!-- some more activities -->

            <activity
                android:name="com.test.testytest.LoginActivity"
                android:label="@string/title_activity_login" <!-- the name the app is called in the drawer etc. -->
                android:windowSoftInputMode="adjustResize|stateVisible" >
                <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
            </activity>
    </application>
Run Code Online (Sandbox Code Playgroud)

strings.xml中:

<string name="app_name">Testy Test!</string>
Run Code Online (Sandbox Code Playgroud)

strings_activity_login:

    <string name="title_activity_login">Sign in</string>
Run Code Online (Sandbox Code Playgroud)

当我将Login活动的字符串更改为app_name时,应用程序的名称也会更改.但我很确定应该按照android:label in中的定义来调用应用程序

希望你能帮助我或指出我的错误(也许我只是错过了一些细节).

一点编辑:我不想更改我的登录活动的标签,因为它应该保持"登录".它也应该保持第一个被调用的活动.但抽屉中的App Name应该是定义的.

string android label launch android-manifest

10
推荐指数
1
解决办法
9345
查看次数

如何将元素添加到链接列表的末尾

所以我试图在C++中创建一个函数,它应该在链表的末尾添加一个元素.应该在main-method中调用添加元素的函数.即使列表中没有元素,也应该可以调用它.

到目前为止我所拥有的是以下内容:

int main()
{
   ListElement* l = new ListElement;
   l->digit = 9;
   l->next = NULL;
   appendList(l, 5);
   appendList(l, 7);

   printList(l);

   return 0;
}

void appendList(ListElement *&l, int newDigit)
{
    ListElement *lh = new ListElement;

    if(l == NULL)
    {
        l->digit = newDigit;
        l->next = NULL;
    }
    else
    {
        lh=l;

        while(lh != NULL)
        {
           lh=lh->next;
        }
        lh=lh->next;
        lh->digit = newDigit;
        lh->next = NULL;
        l = lh;
    }
}
Run Code Online (Sandbox Code Playgroud)

不幸的是它只是不起作用.我试过删除或添加参数 - 没什么帮助,我在互联网上找不到合适的答案.所以如果你们中的任何人都可以帮助我,我会非常非常高兴,因为我在这里绝望...

c++ pointers linked-list list singly-linked-list

0
推荐指数
1
解决办法
107
查看次数