小编MSM*_*SMC的帖子

排序android中的对象列表

假设我有以下对象类:

public class Country {
    private int ID;
    private String name;
    private Double distance;
}
Run Code Online (Sandbox Code Playgroud)

我有一个包含许多对象的对象列表:

List<Country> myList;
Run Code Online (Sandbox Code Playgroud)

我如何根据Double distance例如先放置距离较小的物体对列表进行排序?有没有准备好的功能呢?

或者我想在另一个列表中存储3个最小距离的国家/地区.

java sorting android list

2
推荐指数
1
解决办法
2946
查看次数

Sharing text from app to Email app in android

I have the following code which used to send text from my app to Email:

Intent mail = new Intent(Intent.ACTION_VIEW);
            mail.setClassName("com.google.android.gm","com.google.android.gm.ComposeActivityGmail");
                mail.putExtra(Intent.EXTRA_EMAIL, new String[] {  });
                mail.setData(Uri.parse(""));
                mail.putExtra(Intent.EXTRA_SUBJECT, "Country Decryption");
                mail.setType("plain/text");
                mail.putExtra(Intent.EXTRA_TEXT, "my text");
                ctx.startActivity(mail);  
Run Code Online (Sandbox Code Playgroud)

It works , but as you see, it uses Gmail app, how do I make it use Email application instead of Gmail?

I mean this app: 电子邮件应用程序

and what about sharing to Facebook ? I found that Facebook does not support sharing using intent anymore, and …

email android share android-intent

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

标签 统计

android ×2

android-intent ×1

email ×1

java ×1

list ×1

share ×1

sorting ×1