最近犯得一个很2的错误

为了写一个悬浮窗,在网上查了下资料。

public MyFloatView myFV=null;

myFV=new MyFloatView(getApplicationContext()); 

MyFloatView 是一个继承自VIEW类的子类。

结果在跑到getApplicationContext就 source not found 。

在网上查了很多资料也查不到原因。

第二天

看androidmanifest发现漏写了一句 。

<application
android:name=".MyApplication"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity

....

android :name 没写

因为项目中有MyApplication.java这个类。

谨记,谨记。

决定最近多写写项目中犯得错误。当做上学的时候用的错题本

原文地址:https://www.cnblogs.com/anarki1234/p/2864574.html