• android appwigt


    package com.example.test1;
    
    import android.os.Bundle;
    import android.app.Activity;
    import android.content.pm.ActivityInfo;
    import android.content.pm.PackageInfo;
    import android.content.pm.PackageManager;
    import android.content.pm.PackageManager.NameNotFoundException;
    import android.view.Menu;
    import android.widget.Toast;
    
    public class MainActivity extends Activity {
    
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    		super.onCreate(savedInstanceState);
    		//setContentView(R.layout.activity_main);
    	ActivityInfo  activityInfo;
    	try {
            activityInfo=getPackageManager().getActivityInfo(getComponentName(), PackageManager.GET_META_DATA);
          String _getMetaData  =activityInfo.metaData.getString("app.activity.meteactivity");
            Toast.makeText(this,_getMetaData , 3000).show();
    	
    	} catch (NameNotFoundException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    	
    	
    	}
    
    
    
    }
    

     mainifest.xml 

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.example.test1"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="8"
            android:targetSdkVersion="18" />
    
        <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@style/AppTheme" >
            <activity
                android:name="com.example.test1.MainActivity"
                android:label="@string/app_name" >
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
                <meta-data android:name="app.activity.meteactivity" android:value="Hello Good!"></meta-data>
            </activity>
        </application>
    
    </manifest>
  • 相关阅读:
    【转】numpy.random.randn()与rand()的区别
    【转】numpy.random.randn()与rand()的区别
    春节一顿饭,吃懂了分布式资源调度
    春节一顿饭,吃懂了分布式资源调度
    ASP.NET 分页类 简单好用 支持 AJAX 自定义文字
    系统设计摘录CAP
    webapi上传文件
    webuploader上传工具
    Js学习文件上传
    K-means算法Java实现
  • 原文地址:https://www.cnblogs.com/laopo/p/5821539.html
Copyright © 2020-2023  润新知