我正在尝试访问用户的文件,并且我已经尝试过这种方式:
if (ContextCompat.checkSelfPermission(MainActivity.this,
Manifest.permission.READ_EXTERNAL_STORAGE)
!= PackageManager.PERMISSION_GRANTED) {
// Permission is not granted
if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
Manifest.permission.READ_EXTERNAL_STORAGE)) {
} else {
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.READ_CONTACTS},
MY_PERMISSIONS_REQUEST_READ_CONTACTS);
}
} else {
// Permission has already been granted
}
就像here
现在,Android Studio告诉我:无法解析符号MY_PERMISSIONS_REQUEST_READ_CONTACTS
这是为什么?
很抱歉,以前是否有人问过这个问题,但我已经看过了,但找不到解决问题的答案。
预先感谢
最大
答案 0 :(得分:2)
所提及的
=MID(A1,SEARCH("????-??????-??",A1),14)
所以声明它,最好创建一个单独的类为
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Main" width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<table id="Header" width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="12"><a href="http://www.iavschicago.com"><img src="http://www.iavschicago.com/email/campaigns/template/images/Header.jpg" width="600" height="61" alt="IAVS Chicago Header" style="margin:0; padding:0; border:none; display:block;"></a></td>
</tr>
<tr>
<td colspan="12"><a href="http://www.iavschicago.com"><img src="http://www.iavschicago.com/email/campaigns/template/images/IAVS-Banner.jpg" width="600" height="294" alt="Banner" style="margin:0; padding:0; border:none; display:block;"></a></td>
</tr></table>
<table id="MiddleSection" width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="33%" height="36" colspan="4" bgcolor="#CC0001" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h3 style="color: #FFFFFF;">Consulation</h3></td>
<td width="34%" height="36" colspan="4" bgcolor="#000000" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h3 style="color: #FFFFFF;">Design</h3></td>
<td width="33%" height="36" colspan="4" bgcolor="#545554" style="color: #FFFFFF;"><h3 style="color: #FFFFFF; font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">Install</h3></td>
</tr>
<tr>
<td width="33%" height="57" colspan="4" bgcolor="#CC0001" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 10px;" align="center"><table width="93%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="55" valign="top" bgcolor="#CC0001" style="color: #ffffff; font-size: 10px; line-height: 1;">IAVS gets acquainted with your
business to provide the best AV
solution for your vision</td>
</tr>
</tbody>
</table></td>
<td width="34%" height="57" colspan="4" bgcolor="#000000" align="center" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 12px;"><table width="93%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="55" valign="top" bgcolor="#000000" style="color: #ffffff; font-size: 10px; line-height: 1;">The IAVS design and engineering team creates an AV solution based on your vision and budget</td>
</tr>
</tbody>
</table></td>
<td width="33%" height="57" align="center" colspan="4" bgcolor="#545554" style="color: #FFFFFF; font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px;"><table width="93%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="55" valign="top" bgcolor="#545554" style="color: #ffffff; font-size: 10px;">The IAVS installation process is
professional and efficient to meet
your standards</td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td width="33%" height="35" colspan="4" bgcolor="#545554" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h3 style="color: #FFFFFF;">Service</h3></td>
<td width="34%" height="35" colspan="4" bgcolor="#CC0001" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h3 style="color: #FFFFFF;">Asset Management</h3></td>
<td width="33%" height="35" colspan="4" bgcolor="#000000" style="color: #FFFFFF; font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h3 style="color: #FFFFFF;">Training</h3></td>
</tr>
<tr>
<td width="33%" height="59" align="center" colspan="4" bgcolor="#545554" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 12px;"><table width="93%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="55" valign="top" bgcolor="#545554" style="color: #ffffff; font-size: 10px; line-height: 1;">IAVS provides quality service in the
areas of troubleshooting, repairing
and onsite or remote programming
</td>
</tr>
</tbody>
</table></td>
<td width="34%" height="59" align="center" colspan="4" bgcolor="#CC0001" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #FFFFFF; font-size: 12px;"><table width="93%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="55" valign="top" bgcolor="#CC0001" style="color: #ffffff; font-size: 10px; line-height: 1;"> IAVS can help you manage your AV
assets to save you time and money</td>
</tr>
</tbody>
</table></td>
<td width="33%" height="59" align="center" colspan="4" bgcolor="#000000" style="color: #FFFFFF; font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px;"><table width="93%" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td height="55" valign="top" bgcolor="#000000" style="color: #ffffff; font-size: 10px; line-height: 1;">IAVS offers customized equipment
and system training packages
based on your needs</td>
</tr>
</tbody>
</table></td>
</tr>
</table>
<table id="LowerSection" width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<td colspan="12">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Email-Look_15.jpg" width="100%" height="21" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
</tr>
<tr>
<td rowspan="2" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Email-Look_16.jpg" width="20" height="204" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td width="290" height="34" colspan="4" bgcolor="#FFFFFF" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h2 style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-style: italic;">Markets We Serve</h2></td>
<td rowspan="2" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Email-Look_18.jpg" width="11" height="204" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td width="263" height="34" colspan="5" bgcolor="#FFFFFF" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><h2>Why Choose <span style="color: #CC0001;">IAVS</span>?</h2></td>
<td rowspan="2">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Email-Look_20.jpg" width="16" height="204" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
</tr>
<tr>
<td width="290" align="center" height="170" colspan="4" valign="top" bgcolor="#FFFFFF" style="line-height: 1">IAVS provides solutions to the following markets:<table width="285" border="0" cellspacing="10">
<tbody>
<tr>
<td width="36" height="28"><img src="http://www.iavschicago.com/email/campaigns/template/images/RedCheckmark.png" width="25" height="19" alt="" style="margin:0; padding:0; border:none; display:block;"></td>
<td style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><strong>Corporations</strong></td>
</tr>
<tr>
<td><img src="http://www.iavschicago.com/email/campaigns/template/images/RedCheckmark.png" width="25" height="19" alt="" style="display: block;"></td>
<td style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><strong>Education</strong></td>
</tr>
<tr>
<td><img src="http://www.iavschicago.com/email/campaigns/template/images/RedCheckmark.png" width="25" height="19" alt="" style="margin:0; padding:0; border:none; display:block;"></td>
<td style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1;"><strong>Food & Beverage Establishments</strong></td>
</tr>
<tr>
<td><img src="http://www.iavschicago.com/email/campaigns/template/images/RedCheckmark.png" width="25" height="19" alt="" style="margin:0; padding:0; border:none; display:block;"></td>
<td style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><strong>Government</strong></td>
</tr>
<tr>
<td><img src="http://www.iavschicago.com/email/campaigns/template/images/RedCheckmark.png" width="25" height="19" alt="" style="margin:0; padding:0; border:none; display:block;"></td>
<td style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><strong>Houses of Worship</strong></td>
</tr>
<tr>
<td><img src="http://www.iavschicago.com/email/campaigns/template/images/RedCheckmark.png" width="25" height="19" alt="" style="margin:0; padding:0; border:none; display:block;"></td>
<td style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"><strong>Residential</strong></td>
</tr>
</tbody>
</table></td>
<td width="263" height="170" colspan="5" valign="top" bgcolor="#FFFFFF" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1;">
<p>IAVS uses cutting edge technology to ensure your solution will advance the internal communication and growth of your organization. IAVS believes in
providing the best in quality, customer service, and pricing. We are known for the personal touch we provide to our clients.</p>
<p><strong>Innovative AV Systems (IAVS) is
a Chicago-based audio visual company</strong></p>
</td>
</tr></table>
<table id="Footer" width="600" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="9" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Footer.jpg" width="484" height="29" align="absbottom" alt="Footer" style="margin:0; padding:0; border:none; display:block;">
</td>
<td rowspan="2">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Email-Look_24.jpg" width="74" height="70" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td colspan="2" rowspan="2">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Footer-10.jpg" width="42" height="70" alt="Footer" style="margin:0; padding:0; border:none; display:block;">
</td>
</tr>
<tr>
<td colspan="2" style="font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Footer-11.jpg" width="41" height="41" align="absbottom" alt="Footer" style="margin:0; padding:0; border:none; display:block;">
</td>
<td width="144" height="41" bgcolor="#000000" style="font-size: 11px; color: #FFFFFF; font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 1; display: block">
<a style="text-decoration: none; color: #FFFFFF;" href="http://www.iavschicago.com"><span style="color: #FFFFFF; text- decoration: none;"><font color="#FFFFFF">www.iavschicago.com</font></span></a><br>
(708) 637 4142 </td>
<td width="181" height="41" colspan="4" bgcolor="#000000" style="font-size: 12px; color: #FFFFFF; font-family: Gotham, 'Helvetica Neue', Helvetica, Arial, sans-serif;"> <a style="text-decoration: none; color: #FFFFFF; display: block" href="mailto:sales@iavschicago.com"><span style="color: #FFFFFF; text- decoration: none;"><font color="#FFFFFF">Email:sales@iavschicago.com</font></span></a>
</td>
<td colspan="2">
<img src="http://www.iavschicago.com/email/campaigns/template/images/Footer-12.jpg" width="119" height="41" align="absbottom" alt="Footer" style="display: block;">
</td>
</tr>
<tr>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="20" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="21" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="143" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="16" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="110" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="11" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="44" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="36" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="83" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="74" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="26" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
<td>
<img src="http://www.iavschicago.com/email/campaigns/template/images/spacer.gif" width="16" height="1" alt="" style="margin:0; padding:0; border:none; display:block;">
</td>
</tr>
</table>
</table>
</body>
</html>
并将其用作
// MY_PERMISSIONS_REQUEST_READ_CONTACTS is an
// app-defined int constant. The callback method gets the
// result of the request.
答案 1 :(得分:0)
您需要先声明该变量,然后再使用它。 尝试添加此行
public class ApplicationUser : IdentityUser
{
public const string DisplayNameClaimType = "FirstName";
[Display(Name = "First Name")]
public string FirstName { get; set; }
//etc.
}
答案 2 :(得分:0)
下面的消息在您发送的链接中
MY_PERMISSIONS_REQUEST_READ_CONTACTS是应用程序定义的int常量。回调方法获取请求的结果。
MY_PERMISSIONS_REQUEST_READ_CONTACTS是一个int变量,您可以使用它来获取请求的结果。如果您不想要结果,只需输入0(或另一个int> 0)
答案 3 :(得分:0)
MY_PERMISSIONS_REQUEST_READ_CONTACTS是应用程序定义的常量。因此,您应该创建公共静态整数MY_PERMISSIONS_REQUEST_READ_CONTACTS = 45;我以45为例,但可以是任何常数。