Compare commits

..

No commits in common. 'master' and 'a_branch' have entirely different histories.

@ -1,32 +0,0 @@
## 问题 1 **Could not find com.android.tools.build:gradle:7.4.1**
- 打开 build.gradle(:app)文件在添加两行 google(),之所以添加 google()是因为 jcenter()已经在 Android 上被废弃了。
[![p9SzSeS.png](https://s1.ax1x.com/2023/04/15/p9SzSeS.png)]
- google()指的是 Google 自家的仓库,比如我们使用的很多第一方库,如 RecyclerView, Jetpack Components 等等就是从这里拉取的。
- jcenter()指的就是由 JFrog 提供的 JCenter 仓库,几乎 Android 上所有的第三方开源项目都会选择将库发布到这里,比如你在项目中集成的 OkHttp、Retrofit、RxJava 等等第三方库都是从这里拉取的。
## 问题 2Cannot resolve method 'setLatestEventlnfo' in 'Notification'
在低于 API Level 11 版本,也就是 Android 2.3.3 以下的系统中setLatestEventInfo()函数是唯一的实现方法;而在高于 API Level 11 的版本中 setLatestEventInfo()函数已经被弃用了,于是需要根据现有的 Android 版本进行相应地重写该函数
[![p9pp4s0.png](https://s1.ax1x.com/2023/04/15/p9pp4s0.png)](https://imgse.com/i/p9pp4s0)
## 问题 33 files found with path 'META-INF/DEPENDENCIES'.\*\*
这是在安装依赖的时候路径有问题,导致项目无法找到依赖包
直接在 build.gradle(:app)文件中加入
> useLibrary 'org.apache.http.legacy'
> [![p9p9Xtg.png](https://s1.ax1x.com/2023/04/15/p9p9Xtg.png)](https://imgse.com/i/p9p9Xtg)
> 并 sync now多次点击。
## 问题 4HttpEntity 问题的解决
通过查阅官方文档得到解决方案。
[![p974HRs.png](https://s1.ax1x.com/2023/05/24/p974HRs.png)](https://imgse.com/i/p974HRs)
## 问题:安装完成后不显示菜单栏
在 github 上有位热心网友提供了解决方法。
[![p9Szpdg.md.png](https://s1.ax1x.com/2023/04/15/p9Szpdg.md.png)]
完美解决。

@ -64,10 +64,6 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
} }
private void showNotification(int tickerId, String content) { private void showNotification(int tickerId, String content) {
Notification notification = new Notification(R.drawable.notification, mContext
.getString(tickerId), System.currentTimeMillis());
notification.defaults = Notification.DEFAULT_LIGHTS;
notification.flags = Notification.FLAG_AUTO_CANCEL;
PendingIntent pendingIntent; PendingIntent pendingIntent;
if (tickerId != R.string.ticker_success) { if (tickerId != R.string.ticker_success) {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
@ -77,11 +73,20 @@ public class GTaskASyncTask extends AsyncTask<Void, String, Integer> {
pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext, pendingIntent = PendingIntent.getActivity(mContext, 0, new Intent(mContext,
NotesListActivity.class), 0); NotesListActivity.class), 0);
} }
notification.setLatestEventInfo(mContext, mContext.getString(R.string.app_name), content,
pendingIntent);
Notification.Builder builder = new Notification.Builder(mContext)
.setAutoCancel(true)
.setContentTitle(mContext.getString(R.string.app_name))
.setContentText(content)
.setContentIntent(pendingIntent)
.setWhen(System.currentTimeMillis())
.setOngoing(true);
Notification notification=builder.getNotification();
mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification); mNotifiManager.notify(GTASK_SYNC_NOTIFICATION_ID, notification);
} }
@Override @Override
protected Integer doInBackground(Void... unused) { protected Integer doInBackground(Void... unused) {
publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity publishProgess(mContext.getString(R.string.sync_progress_login, NotesPreferenceActivity

Loading…
Cancel
Save