Android:我可以将帐户的凭据从Activity传递到服务类吗?

时间:2016-11-08 19:30:33

标签: android android-activity

我创建了一个向Google日历发出请求的活动,我可以将帐户的凭据从活动发送到服务类

global $wpdb;

$all_needed = $wpdb->get_results('SELECT wp_posts.id FROM wp_posts, wp_postmeta 
WHERE (post_type = 'ads') 
OR 
(post_type = 'product' AND meta_key = '_vendor_product' AND meta_value = 1) 
AND 
wp_posts.ID = wp_postmeta.post_id');

// extract_ids is a pseudo-code function - check what the result actually is and make an array of post_ids
$post_ids = extract_ids($all_needed)

// now you have your single query
$query = new WP_Query(array('post__in'=>$post_ids));

// proceed ....

这是使用谷歌帐户的活动的一部分,我想在Service类中做的是控制如果当天有事件,我试图通过intent.putExtras()传递凭证但是不起作用,我尝试也传递了凭证,定义了一个方法,在Application类中使用putCredential()和getCredential(),但是当我在Service类中调用它但返回nullpointerexception时

0 个答案:

没有答案