sweet alert dialog 在android studio应用问题说明详解

作者:IT流渊 时间:2022-12-14 04:17:53 

看到这个sweet-alert-dialog很亲切,因为前端开发本人用的提示就是这个js插件,java牛人很厉害,直接弄成一个java包插件,Good!

下面记录如何引用到工程,并使用:

sweet-alert-dialog插件可以直接到github上下载

地址:https://github.com/pedant/sweet-alert-dialog

或者直接到发布好的页面下载:

https://github.com/pedant/sweet-alert-dialog/releases

我下载的是:sweet-alert-dialog-1.1版本zip包

将下载sweet-alert-dialog-1.1包解压出来,再你的app项目中,打开 File -> New -> Import Module 选择到刚才解压的文件夹

sweet alert dialog 在android studio应用问题说明详解
sweet alert dialog 在android studio应用问题说明详解
sweet alert dialog 在android studio应用问题说明详解

报错:

Error:Dependency Myalert:sweetalertdialog:unspecified on project app resolves to an APK archive which is not supported as a compilation dependency. File: D:\AndroidStudioProjects\TEST\Myalert\sweetalertdialog\build\outputs\apk\sweetalertdialog-release-unsigned.apk

可以先Build一下sweet-alert-dialog工程。

另外你的工程Gradle Scripts目录下的bulid.gradle (Module:app)下


dependencies {
compile fileTree(include: [‘*.jar'], dir: ‘libs')
testCompile ‘junit:junit:4.12'
compile ‘com.android.support:appcompat-v7:24.1.1'
compile ‘cn.pedant.sweetalert:library:1.3'
}

引入:compile ‘cn.pedant.sweetalert:library:1.3'

Build app出现新的错误信息:

Error:Execution failed for task ‘:app:processDebugManifest'.
Manifest merger failed : Attribute application@icon value=(@mipmap/ic_launcher) from AndroidManifest.xml:7:9-43
is also present at [com.pnikosis:materialish-progress:1.0] AndroidManifest.xml:13:9-45 value=(@drawable/ic_launcher).
Suggestion: add ‘tools:replace=”android:icon”' to element at AndroidManifest.xml:5:5-18:19 to override.

解决方法:

修改AndroidManifest.xml:

在manifest添加 xmlns:tools=”http://schemas.android.com/tools”

在application添加 tools:replace=”android:icon,android:theme,android:allowBackup,android:label,android:supportsRtl”

将在application中所用到的全部android:都在上面tools:replace=添加进去,逗号分隔。

如下:


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="cn.cgrs.myalert">
<application
tools:replace="android:allowBackup,android:icon,android:label,android:supportsRtl,android:theme"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>

到此sweet-alert-dialog已完成配置,可以开始随意使用了….

以上所述是小编给大家介绍的sweet alert dialog 在android studio应用问题说明详解网站的支持!

来源:http://blog.csdn.net/W3031213101/article/details/52604313

标签:sweet,alert,dialog,android,studio
0
投稿

猜你喜欢

  • 一文掌握Spring的创建与使用

    2022-01-24 19:28:38
  • Java多线程下的单例模式参考

    2023-11-09 00:40:15
  • java 动态增加定时任务示例

    2023-07-29 06:56:00
  • WinForm实现最小化到系统托盘方法实例详解

    2023-10-05 05:53:30
  • java开发分布式服务框架Dubbo原理机制详解

    2023-01-04 19:53:01
  • Android Beam 文件传输失败分析与解决方法

    2023-03-16 18:15:27
  • C#中抽象方法与虚拟方法的区别

    2021-10-30 07:30:15
  • python、java等哪一门编程语言适合人工智能?

    2021-06-04 03:22:53
  • 浅谈Java中ArrayList线程不安全怎么办

    2023-10-02 19:24:56
  • java搭建ftp/sftp进行数据传递的全过程

    2023-11-29 15:08:10
  • C# 获取打印机当前状态的方法

    2021-09-29 19:54:43
  • 如何实现Java中一个简单的LinkedList

    2023-03-12 11:55:02
  • Lucene 索引删除策略源码解析

    2023-11-21 00:11:01
  • Java实现用户管理系统

    2023-08-26 17:18:21
  • 一文详解Java Netty中的Constant类

    2023-03-03 17:17:55
  • Java用for循环Map详细解析

    2021-06-08 08:23:03
  • IDEA配置使用Maven Helper插件的方法(详细配置)

    2022-07-17 03:09:21
  • 一个Servlet是如何处理多个请求的?

    2023-01-18 11:19:32
  • 使用java基础类实现zip压缩和zip解压工具类分享

    2021-11-23 08:03:41
  • C#中调用命令行cmd开启wifi热点的实例代码

    2023-11-28 03:15:04
  • asp之家 软件编程 m.aspxhome.com