6.0通知栏去掉了
notification.setLatestEventInfo(context, tipTitle, msg, contentIntent);
方法
可以使用如下方法替换:
http://zhidao.baidu.com/link?url=aZe1zgBSBsf9xCYNpcz2fVAy1O1SqOoFSptNZdyLbs8DZVh0f7kbx4AsJ8UFqubdFR8xWmTwT7eTgG2yyp6UX07cMQ1MCxN6dWUZlQmUfLu

原始的:NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);            Notification notification = new Notification(                    R.drawable.ic_launcher, "title", System.currentTimeMillis());            notification.defaults = 0;            Uri uri = Uri.parse("http://baidu.com");            Intent intent = new Intent(Intent.ACTION_VIEW, uri);            intent.setComponent(null);            PendingIntent pi = PendingIntent.getActivity(                    getApplicationContext(), 0, intent, 0);            notification.setLatestEventInfo(getApplicationContext(), "title",                    "content", pi);            mNotificationManager.notify(1000, notification);V4的:NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);            NotificationCompat.Builder builder = new NotificationCompat.Builder(                    getApplicationContext());            builder.setSmallIcon(R.drawable.ic_launcher);            builder.setDefaults(0);            builder.setAutoCancel(true);            builder.setContentTitle("title");            builder.setContentText("content");            Uri uri = Uri.parse("http://baidu.com");            Intent intent = new Intent(Intent.ACTION_VIEW, uri);            intent.setComponent(null);            PendingIntent pendingIntent = PendingIntent.getActivity(                    getApplicationContext(), 0, intent, 0);            builder.setContentIntent(pendingIntent);            mNotificationManager.notify(1000, builder.build());

如果把版本提高至22以上出现这个问题
Error retrieving parent for item: No resource found that matches the given name ‘android:Widget.Material.Button.Colored’.
参考如下方法解决:
1.
http://stackoverflow.com/questions/26530415/error-in-styles-base-xml-file-android-app-no-resource-found-that-matches-the

Go to your Android SDK installed directory then extras > android > support > v7 > appcompat.in my case : D:\Software\adt-bundle-windows-x86-20140702\sdk\extras\android\support\v7\appcompatonce you are in appcompat folder ,check for project.properties file then change the value from default 19 to 21 as : target=android-21. save the file and then refresh your project. Then clean the project : In project tab , select clean option then select your project and clean... This will resolve the error. enjoy coding...

2.http://bbs.csdn.net/topics/391813146
改下build.gradle文件,将里面的compileSdkVersion改为23即可
gradle版本改为1.3.0

3.如果使用:
compile ‘com.google.android.gms:play-services:8.1.0’
出现:No resource found that matches the given name ‘android:Widget.Material.ActionButton’
请用旧版本修复

The last version of Google Play Services now uses appcompat-v7, so u can't use it with actionbarsherlock. You have to use only appcompat-v7 or the previous version of play services:compile 'com.google.android.gms:play-services:7.0.0'

参考:
http://www.07net01.com/2015/07/877878.html
http://stackoverflow.com/questions/18745803/gradle-error-attribute-xxx-has-already-been-defined-in-android-studio

4(终极方案,如果还是不行,那就没得玩了)到官网下载最新的sdk(如果sdk是从就版本更新上来的,问题依旧会出现,建议重新下载最新的)
http://developer.android.com/sdk/index.html

更多相关文章

  1. Android AlertDialog的基本使用方法
  2. Android之设置横、竖屏方法
  3. 在4.0以上系统中应用出现2.3版本的系统UI
  4. Android获取本机Mac地址及IP地址方法
  5. Android中NDK各版本下载

随机推荐

  1. 论文之自学android 开发
  2. Android(安卓)API Guides---Supporting M
  3. Android借助系统自带图片裁剪集成图片选
  4. android中的通信机制总结1:使用handler来
  5. Android学习笔记(一)---一定要看的 Android
  6. Android(安卓)彻底组件化方案实践
  7. Android(安卓)API Guides---Building Web
  8. Android(安卓)LifecycleObserver & Sched
  9. Android-手机归属地和座机归属地查询
  10. 转:APK程序卸载二次确认的实现