我正在使用画布应用程序,我创建了一个带有颜色选择器,撤消,重做和清除功能的画布,它也工作正常.现在,我想验证用户当前是否在画布上的背景线上绘制一条线.
例如,我有一个带虚线的背景图像,现在我希望用户在虚线上绘图,我必须验证它是否正确?在画布中是否可以,我该如何处理?
有人可以给出任何关于这个的建议,这对我来说真的很有帮助我继续我的应用程序的下一步,我的代码在这里,
public class HomeScreen extends Activity implements ColorPickerDialog.OnColorChangedListener {
public int width;
public int height;
public Arrays paths1;
private Bitmap mBitmap;
private Canvas mCanvas;
private Path mPath;
private Paint mBitmapPaint;
Context context;
private Paint circlePaint;
private Path circlePath;
/* MyView mv; */
DrawingPanel dp;
AlertDialog dialog;
private ArrayList<Path> undonePaths = new ArrayList<Path>();
private ArrayList<Path> paths = new ArrayList<Path>();
FrameLayout frmLayout;
Canvas canvas;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home_screen);
dp = new DrawingPanel(this);
frmLayout = (FrameLayout) findViewById(R.id.frameLayout); …Run Code Online (Sandbox Code Playgroud) 我正在使用此代码并从日历中获取事件,它工作正常,但是,我想从谷歌帐户日历中获取事件。例如,我也想获取 (deepakcando90@gmail.com )谷歌日历帐户事件?我知道可以,但不知道如何实现?
我的代码是,
public static void readCalendarEvent(Context context) throws ParseException {
ContentResolver contentResolver = context.getContentResolver();
Calendar calendar = Calendar.getInstance();
String dtstart = "dtstart";
String dtend = "dtend";
SimpleDateFormat displayFormatter = new SimpleDateFormat("EEEE, MMMM dd, yyyy");
stime=displayFormatter.format(calendar.getTime());
SimpleDateFormat startFormatter = new SimpleDateFormat("MM/dd/yy");
String dateString = startFormatter.format(calendar.getTime());
long after = calendar.getTimeInMillis();
SimpleDateFormat formatterr = new SimpleDateFormat("hh:mm:ss MM/dd/yy");
Calendar endOfDay = Calendar.getInstance();
Date dateCCC = formatterr.parse("47:59:59 " + dateString);
endOfDay.setTime(dateCCC);
cursor = contentResolver.query(Uri.parse("content://com.android.calendar/events"), (new String[] { "calendar_id", "title", "description", "dtstart", "dtend", "eventLocation" …Run Code Online (Sandbox Code Playgroud) 我有以下字符串:
String description= errex for Screen Share
https://ednovo.webex.com/ednovo/j.php?ED=224466857&UID=1465621292&RT=MiM0
You can find the meeting notes here https://docs.yahoo.com/a/filter.org/document/d/1Luf_6Q73_Lm30t3x6wHS_4Ztkn7HfXDg4sZZWz-CuVw/edit?usp=sharing
Run Code Online (Sandbox Code Playgroud)
我想删除网址链接并以此结束:
String description=errex for Screen Share You can find the meeting notes here
Run Code Online (Sandbox Code Playgroud)
我尝试了以下代码,但它没有检测到URL:
private String removeUrl(String commentstr)
{
String commentstr1=commentstr;
String urlPattern = "((https?|ftp|gopher|telnet|file|Unsure|http):((//)|(\\\\))+[\\w\\d:#@%/;$()~_?\\+-=\\\\\\.&]*)";
Pattern p = Pattern.compile(urlPattern,Pattern.CASE_INSENSITIVE);
Matcher m = p.matcher(commentstr1);
int i=0;
while (m.find()) {
commentstr1=commentstr1.replaceAll(m.group(i),"").trim();
i++;
}
System.out.println("After url filter" +commentstr1);
return commentstr1;
}
Run Code Online (Sandbox Code Playgroud)
这有什么不对?
我想在按下后退按钮时向用户显示一个警报对话框。例如:您确定要退出吗?我在创建警报对话框时没有遇到问题。我在在哪里调用此对话框方法()。
这是我的 HomeScreen.java
public class HomeScreen extends TabActivity {
ConferenceOpenHelper helper_ob;
Cursor cursorHome;
ProfileEditScreen profileEditScreen;
ConferenceAdapter adapter;
EcMeeting meeting;
final Context context = this;
public static int HOMETEMP = 1;// Constant for Deleting the last created id
// in edit profile screen (Cancel)
public static String HOME = "home";// constant for updating status column
public static String CUSTOM_DIALER = "custom";
public static String TEMPLATE = "template";// constant for updating status // column
public static TabHost tabHost;
public static final int …Run Code Online (Sandbox Code Playgroud)