小编Ome*_*ega的帖子

无法为参数org.gradle.api.Project找到方法android()

得到一个bug,当我尝试在工作室中编译我的项目时,我已经搜索了很多而没有真正的解决方案

错误:(17,0)无法在类型为org.gradle.api.Project的根项目'booksStudioDir'中找到参数[build_a7zf1o8ge4ow4uolz6kqzw5ov $ _run_closure2 @ 19201053]的方法android().

这是我的构建/ gradle文件的示例

buildscript {
repositories {
    maven { url 'https://maven.fabric.io/public' }
}

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
  }
 }
  apply plugin: 'com.android.application'
apply plugin: 'io.fabric'


android {
compileSdkVersion 21
buildToolsVersion "23.0.1"

defaultConfig {
    applicationId "com.peade.time"
    minSdkVersion 10
    targetSdkVersion 13
}
signingConfigs {
    release {
        storeFile file("/home/bestman/Desktop/mkey/key")
        storePassword "androidkeys"
        keyAlias "peade"
        keyPassword "yes1234"
    }
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'),    'proguard-rules.txt'
        signingConfig signingConfigs.release
     }
  }
}
  repositories {
    maven { url 'https://maven.fabric.io/public' } …
Run Code Online (Sandbox Code Playgroud)

java android gradle android-gradle-plugin

9
推荐指数
1
解决办法
3万
查看次数

增加浮动子操作按钮的大小

我使用的是CircularFloatingActionMenu库,我已经成功实现了这个库,但我想增加4个子动作按钮的大小

请在下面找到使用的代码

final ImageView fabIconNew = new ImageView(this);
  fabIconNew.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_new));
final FloatingActionButton rightLowerButton = new FloatingActionButton.Builder(this)
        .setContentView(fabIconNew)
        .build();


SubActionButton.Builder rLSubBuilder = new SubActionButton.Builder(this);
ImageView rlIcon1 = new ImageView(this);
ImageView rlIcon2 = new ImageView(this);
ImageView rlIcon3 = new ImageView(this);
ImageView rlIcon4 = new ImageView(this);
//ImageView rlIcon6 = new ImageView(this);


rlIcon1.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_contact));
rlIcon2.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_currency_info));
rlIcon3.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_exhibition));
rlIcon4.setImageDrawable(getResources().getDrawable(R.drawable.ic_action_faq));
Run Code Online (Sandbox Code Playgroud)

图片

android floating-action-button action-button

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

无法解析android通知中的方法setLatestEventInfo

我刚刚导入了一个android项目,并且在Notification部分中,我必须使用setLatestEventInfo。但是Android Studio说无法解析方法setLatestEventinfo。这是我的代码段,请在回答时帮助您编辑我的代码

            NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
            Notification notification = new Notification(R.drawable.ic_launcher,"CEPF Mobile",0);
            Intent notify_intent = new Intent(context,SpecialSerivceReportActivity.class);
            notify_intent.putExtra("filename", "Special Service Report");
            notify_intent.putExtra("URL", urls[0]);
            PendingIntent contentIntent = PendingIntent.getActivity(context,(int)System.currentTimeMillis(),notify_intent,PendingIntent.FLAG_ONE_SHOT);
            notification.setLatestEventInfo(context, "CEPF Mobile", "New post in Special Service Report", contentIntent);
            notification.flags = Notification.FLAG_AUTO_CANCEL;
            notification.defaults = Notification.DEFAULT_SOUND ;
            nm.notify((int)System.currentTimeMillis(),notification);
            }
            else if(message.equalsIgnoreCase("Special Columnist Blog"))
            {

            NotificationManager nm = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
            Notification notification = new Notification(R.drawable.ic_launcher,"CEPF Mobile",0);
            Intent notify_intent = new Intent(context,SpecialSerivceReportActivity.class);
            notify_intent.putExtra("filename", "Special Columnist Blog");
            notify_intent.putExtra("URL", urls[1]);
            PendingIntent contentIntent = PendingIntent.getActivity(context,(int)System.currentTimeMillis(),notify_intent,PendingIntent.FLAG_ONE_SHOT);
            notification.setLatestEventInfo(context, "CEPF Mobile", "New …
Run Code Online (Sandbox Code Playgroud)

notifications android notificationmanager

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