亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

地圖活動的意圖問題 - 如何解決?

地圖活動的意圖問題 - 如何解決?

開心每一天1111 2022-06-04 14:51:15
我需要創建一個必須在下周通過的活動?;顒邮怯?2 個按鈕(相機和地圖)制作一個主頁,這意味著我必須使用意圖功能來工作這個應用程序。但是我有一個問題,相機按鈕可以正常工作,但我的地圖無法正常工作,這就是我在這里尋求幫助的原因。我試過地圖=(Button) findViewById(R.id.map);        map.setOnClickListener(new View.OnClickListener() {            @Override            public void onClick(View v)            { openMapsActivity();            }        });然后public void openMapsActivity() {        Intent intent = new Intent(this, MapsActivity.class);        startActivity(intent);    }
查看完整描述

1 回答

?
呼喚遠方

TA貢獻1856條經驗 獲得超11個贊

像這樣更新您的清單應用程序:


<application

    android:allowBackup="true"

    android:icon="@mipmap/ic_launcher"

    android:label="@string/app_name"

    android:roundIcon="@mipmap/ic_launcher_round"

    android:supportsRtl="true"

    android:theme="@style/AppTheme">


    <!--

         The API key for Google Maps-based APIs is defined as a string resource.

         (See the file "res/values/google_maps_api.xml").

         Note that the API key is linked to the encryption key used to sign the APK.

         You need a different API key for each encryption key, including the release key that is used to

         sign the APK for publishing.

         You can define the keys for the debug and release targets in src/debug/ and src/release/.

    -->

    <meta-data

        android:name="com.google.android.geo.API_KEY"

        android:value="@string/google_maps_key" />


    <activity

        android:name=".MainActivity"

        android:label="@string/title_activity_maps">

        <intent-filter>

            <action android:name="android.intent.action.MAIN" />


            <category android:name="android.intent.category.LAUNCHER" />

        </intent-filter>

    </activity>

   <activity

        android:name=".MapsActivity"

        android:screenOrientation="portrait" />

</application>


查看完整回答
反對 回復 2022-06-04
  • 1 回答
  • 0 關注
  • 107 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號